From 1200d2e2f04077ed256c0d40d0e7b3fbd12c9f3d Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 12 Jul 2026 18:09:33 +0000 Subject: [PATCH] chore: single-source the never-rewrite-history policy as a generated block Replace the hand-maintained '## Never rewrite history' section with the generated repos_sync:history block (byte-identical text, now drift-checked against PyAutoMind/policy/never_rewrite_history.md). Part of the ecosystem standardization (spec 4). The safety text stays inline; only the manual copy is retired. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01KUGujq6jAgU3CExnLkkELe --- AGENTS.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 31a772f..ed26fb2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -46,15 +46,16 @@ framework, the <30s tick budget, how to add a check, and the hard rules (observer-only, colour coding, atomic state writes). Read it when changing Heart's own code, not by default. + ## Never rewrite history NEVER perform these operations on any repo with a remote: - `git init` in a directory already tracked by git - `rm -rf .git && git init` -- Commit with subject "Initial commit", "Fresh start", "Start fresh", - "Reset for AI workflow", or any equivalent message on a branch with a remote -- `git push --force` to `main` +- Commit with subject "Initial commit", "Fresh start", "Start fresh", "Reset + for AI workflow", or any equivalent message on a branch with a remote +- `git push --force` to `main` (or any branch tracked as `origin/HEAD`) - `git filter-repo` / `git filter-branch` on shared branches - `git rebase -i` rewriting commits already pushed to a shared branch @@ -63,3 +64,10 @@ If the working tree needs a clean state, the **only** correct sequence is: git fetch origin git reset --hard origin/main git clean -fd + +This applies equally to humans, local Claude Code, cloud Claude agents, Codex, +and any other agent. The "Initial commit — fresh start for AI workflow" pattern +that appeared independently on origin and local for three workspace repos is +exactly what this rule prevents — it costs ~40 commits of redundant local work +every time it happens. +