Skip to content

Commit 40aed28

Browse files
Jammy2211claude
andauthored
chore: single-source the never-rewrite-history policy as a generated block (#21)
Replace the hand-maintained history-rewrite guidance with the generated repos_sync:history block (byte-identical canonical text from PyAutoMind/policy/never_rewrite_history.md), so the safety policy is single-sourced and drift-checked. The text stays inline; only the manual copy is retired. Part of the ecosystem standardization (spec 4). Claude-Session: https://claude.ai/code/session_01KUGujq6jAgU3CExnLkkELe Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 442db30 commit 40aed28

1 file changed

Lines changed: 25 additions & 10 deletions

File tree

AGENTS.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,28 @@ entries until the summary passes; regenerate notebooks + catalogue after. **Gene
9797
only files in `scripts/` (never `notebooks/`), preserve docstrings and explanations, test, then
9898
regenerate. Flag any change that affects `autogalaxy_workspace` or the source libraries in your PR.
9999

100-
## Clean state
101-
102-
Never rewrite history on a repo with a remote (no `git init` over a tracked tree, no force-push to
103-
`main`, no rebasing pushed shared branches). To reset a dirty tree the only correct sequence is:
104-
105-
```bash
106-
git fetch origin
107-
git reset --hard origin/main
108-
git clean -fd
109-
```
100+
<!-- repos_sync:history:begin -->
101+
## Never rewrite history
102+
103+
NEVER perform these operations on any repo with a remote:
104+
105+
- `git init` in a directory already tracked by git
106+
- `rm -rf .git && git init`
107+
- Commit with subject "Initial commit", "Fresh start", "Start fresh", "Reset
108+
for AI workflow", or any equivalent message on a branch with a remote
109+
- `git push --force` to `main` (or any branch tracked as `origin/HEAD`)
110+
- `git filter-repo` / `git filter-branch` on shared branches
111+
- `git rebase -i` rewriting commits already pushed to a shared branch
112+
113+
If the working tree needs a clean state, the **only** correct sequence is:
114+
115+
git fetch origin
116+
git reset --hard origin/main
117+
git clean -fd
118+
119+
This applies equally to humans, local Claude Code, cloud Claude agents, Codex,
120+
and any other agent. The "Initial commit — fresh start for AI workflow" pattern
121+
that appeared independently on origin and local for three workspace repos is
122+
exactly what this rule prevents — it costs ~40 commits of redundant local work
123+
every time it happens.
124+
<!-- repos_sync:history:end -->

0 commit comments

Comments
 (0)