From bbbb5277086f0c0b8f5e22fbb3b70e2e57690846 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Tue, 30 Dec 2025 18:21:39 -0800 Subject: [PATCH] Add Landing Rule to crew and polecat templates Work is NOT landed until it's either on main or in the Refinery MQ. Feature branches are dangerous in multi-agent environments - the repo baseline can diverge wildly in hours. --- internal/templates/roles/crew.md.tmpl | 35 ++++++++++++++++++++---- internal/templates/roles/polecat.md.tmpl | 13 +++++++++ 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/internal/templates/roles/crew.md.tmpl b/internal/templates/roles/crew.md.tmpl index 2ab0d408..f41614a3 100644 --- a/internal/templates/roles/crew.md.tmpl +++ b/internal/templates/roles/crew.md.tmpl @@ -210,13 +210,27 @@ Your hooked work persists across sessions. The handoff mail is just context note **Crew workers push directly to main. No feature branches.** -Why: -- You own your clone - no isolation needed -- Work is fast (10-15 min) - branch overhead exceeds value -- Branches go stale with context cycling - main is always current -- You're a trusted maintainer, not a contributor needing review +### The Landing Rule + +> **Work is NOT landed until it's either on `main` or submitted to the Refinery MQ.** + +Feature branches are dangerous in multi-agent environments: +- The repo baseline can diverge wildly in hours +- Branches go stale with context cycling +- Merge conflicts compound exponentially with time +- Other agents can't see or build on unmerged work + +**Valid landing states:** +1. **Pushed to main** - Work is immediately available to all agents +2. **Submitted to Refinery** - `gt done` creates MR, Refinery will merge + +**Invalid states (work is at risk):** +- Sitting on a local branch +- Pushed to a remote feature branch but not in MQ +- "I'll merge it later" - later never comes in agent time + +### Workflow -Workflow: ```bash git pull # Start fresh # ... do work ... @@ -226,6 +240,15 @@ git push # Direct to main If push fails (someone else pushed): `git pull --rebase && git push` +### Cross-Rig Work (gt worktree) + +`gt worktree` creates a branch for working in another rig's codebase. This is the +ONE exception where branches are created. But the rule still applies: + +- Complete the work in one session if possible +- Submit to that rig's Refinery immediately when done +- Never leave cross-rig work sitting on an unmerged branch + ## Key Commands ### Finding Work diff --git a/internal/templates/roles/polecat.md.tmpl b/internal/templates/roles/polecat.md.tmpl index ff0e226f..eb7c5e59 100644 --- a/internal/templates/roles/polecat.md.tmpl +++ b/internal/templates/roles/polecat.md.tmpl @@ -207,6 +207,19 @@ When all steps are done, the molecule gets squashed automatically when you run ` Run `gt done` when your work is complete. It verifies git is clean, syncs beads, and submits your branch to the merge queue. The Witness handles the rest. +### The Landing Rule + +> **Work is NOT landed until it's on `main` OR in the Refinery MQ.** + +Your branch sitting on origin is NOT landed. You must run `gt done` to submit it +to the merge queue. Without this step: +- Your work is invisible to other agents +- The branch will go stale as main diverges +- Merge conflicts will compound over time +- Work can be lost if your polecat is recycled + +**Branch → `gt done` → MR in queue → Refinery merges → LANDED** + ## If You're Stuck 1. **File an issue**: `bd create --title="Blocked: " --type=task`