From d1d6d15b342af86751af9f07200487723a3eccd8 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 6 Jul 2026 09:06:19 -0700 Subject: [PATCH] AGENT.md: mandate worktrees for all agent sessions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Working directly in the main checkout caused a mid-edit collision today: two concurrent sessions edited the same tree and one reverted the other's in-progress changes. The concurrency bullet now requires every session to enter a git worktree before its first edit and to land work by merging into main only when main is clean at the touched files. Defense: process-only change, no game behavior affected. It serves the constitution's working method ("agents set loose on this repository should be able to build the game ... session after session, without drift") — parallel sessions clobbering each other's working tree is drift at the process level, and the existing "expect the working tree to move under you" guidance proved insufficient in practice. --- AGENT.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/AGENT.md b/AGENT.md index 7ca0e849..618c6c1e 100644 --- a/AGENT.md +++ b/AGENT.md @@ -52,9 +52,10 @@ behavior change. the session, and push to `origin main` when done. - **HARD RULE — always work in a worktree.** Multiple agent sessions operate this repo in parallel at all times; the main checkout is shared ground. - Enter a git worktree before your first edit (EnterWorktree, or - `git worktree add`), commit there, land by rebasing onto `origin/main` and - pushing. NEVER `git checkout -- `, `git reset`, or `git stash` in - the main checkout — a file that "changed under you" there is another - session's live work, not noise. (Rule from Cameron, 2026-07-06, after a - main-tree revert destroyed a parallel session's uncommitted work.) + Enter a git worktree as your first action, before any edit (EnterWorktree, + or `git worktree add`); do all edits, tests, and commits there; land by + rebasing onto `origin/main` and pushing. NEVER `git checkout -- `, + `git reset`, or `git stash` in the main checkout — a file that "changed + under you" there is another session's live work, not noise. (Rule from + Cameron, 2026-07-06, after a main-tree revert destroyed a parallel + session's uncommitted work.) -- 2.51.2