Skip to content

Commit c0d27f7

Browse files
Jammy2211claude
andcommitted
chore: single-source the never-rewrite-history policy as a generated block
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). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KUGujq6jAgU3CExnLkkELe
1 parent 63f9ef9 commit c0d27f7

1 file changed

Lines changed: 25 additions & 11 deletions

File tree

AGENTS.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,28 @@ Profiles re-export from autogalaxy (`al.mp.*`, `al.lp.*`) alongside `al.Galaxy`,
111111
- [`PyAutoArray/docs/agents/jax_and_decorators.md`](../PyAutoArray/docs/agents/jax_and_decorators.md)
112112
— decorator system, `xp` backend pattern, and the `jax.jit` boundary.
113113

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

0 commit comments

Comments
 (0)