Polecats were creating GitHub PRs instead of using gt done to submit
to the Refinery. Added clear conditional language:
- If repo is steveyegge/beads or steveyegge/gastown: NEVER create PRs
- Polecats use gt done → Refinery merges
- Crew workers push directly to main
- PRs are for external contributors only
This fixes a prompting gap that led to PR #292 being created incorrectly.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Phase 3 of heresy correction: polecat branches stay local, Refinery
accesses them via shared .repo.git.
Changes:
- templates/polecat-CLAUDE.md: Remove push from completion checklist
- mol-polecat-work.formula.toml: Remove push step from cleanup-workspace
- polecat.md.tmpl: Update landing rule for local branches
- refinery.md.tmpl: Change origin/polecat to local branch references
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Clarifies the three distinct lifecycle layers to prevent confusion:
- Session (Claude context): ephemeral, cycles per step
- Sandbox (worktree): persistent until nuke
- Slot (name from pool): persistent until nuke
Addresses anti-patterns like "idle polecats" and misunderstanding
what recycling means. (gt-bc6gm)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PROBLEM: Agents were reading formula files directly and manually creating beads
for each step, rather than using the cook→pour→molecule pipeline.
FIXES:
- polecat-CLAUDE.md: Changed "following the formula" to "work through your
pinned molecule" and added explicit anti-pattern warning
- mol-polecat-work.formula.toml: Added note that formula defines template,
use bd ready to find step beads
- docs/molecules.md: Added "Common Mistake" section with WRONG/RIGHT examples
- mol-*.formula.toml (5 files): Changed "execute this formula" to "work
through molecules (poured from this formula)"
The key insight: Formulas are source templates (like source code). You never
read them directly. The cook → pour pipeline creates step beads for you.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update polecat template to reflect the new --exit flag behavior:
- Completion checklist now uses `gt done --exit` instead of waiting
- Remove "Wait for Witness" step - polecats now self-terminate
- Update Polecat Contract to reflect new exit flow
- Remove outdated "Don't exit yourself" guidance
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Witnesses were sending HEALTH_OK mail to mayor on every deacon health
check (~30s), flooding the inbox. Updated witness templates to:
- Explicitly state NOT to mail on HEALTH_CHECK nudges
- Explain that Deacon tracks health via session status
- Add gotcha note in the main template
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Witnesses should send HEALTH_OK to deacon/, not mayor/deacon.
Added explicit Health Check Protocol section to the witness template
explaining the correct address and why.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove routine POLECAT_PROCESSED and WITNESS_REPORT/REFINERY_REPORT
mail types from Witness→Mayor communication.
Changes:
- Remove Notify Mayor step for routine polecat processing from
witness-CLAUDE.md template
- Remove WITNESS_REPORT and REFINERY_REPORT callback types from
callbacks.go (pattern matching, handlers, constants)
- Update callback help text to reflect new behavior
Witness now handles routine lifecycle autonomously. Only genuine
problems that require human/Mayor intervention are escalated:
- ESCALATION (problems Witness cannot resolve)
- BLOCKED (needs human decision)
- CRASH_RECOVERY (informational)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Role templates (crew, polecat, mayor, deacon, witness, refinery)
- prime.go startup protocol messages
- Documentation (propulsion, reference, molecules, wisp architecture)
- Session hints and sling prompts
- Formula template instructions
- CLAUDE.md
The hook is the user-facing concept, molecules are implementation details.
Agents should use `gt hook` to check what work is assigned to them.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add gt polecat check-recovery command to check cleanup_status from agent bead
- Update gt polecat nuke to block on polecats with unpushed work (use --force to override)
- Add EscalateRecoveryNeeded function for RECOVERY_NEEDED escalations
- Update Witness template with dormant polecat recovery protocol
Prevents accidental data loss when cleaning up dormant polecats that have
unpushed commits. The Witness should now use check-recovery before nuking
and escalate NEEDS_RECOVERY cases to the Mayor.
(gt-cloml)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The witness template previously instructed using raw git commands:
- git worktree remove polecats/<name>
- git branch -d polecat/<name>
This failed because git worktree operations must run from the repo
that created the worktree (mayor/rig or .repo.git), not the rig root.
Now uses `gt polecat nuke` which handles repo base detection via
the repoBase() function and properly cleans up worktrees.
Fixes gt-gp6i
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Polecats were going off-task during swarms. Added explicit guidance:
- ONE job: work your pinned bead until done
- DO NOT list for common distractions (mail checking, monitoring others, etc.)
- Reminder to file discovered work as beads, not fix it
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixed two integration test bugs:
gt-hj0ei: Polecat wrote files outside worktree
- Added CRITICAL directory discipline section at top
- Emphasizes staying in polecats/<name>/ directory
gt-ibuga: Polecat didnt commit before gt done
- Replaced vague completion protocol with explicit checklist
- Uses gt done command instead of manual mail
Created witness-CLAUDE.md template that emphasizes the critical
MERGE_READY step in the pre-kill verification checklist.
The witness must send MERGE_READY to refinery BEFORE killing a polecat
session, so the refinery knows which branch to merge.
Uses {{RIG}} placeholder for rig-specific deployment.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Complete redesign of polecat work formula with 8 concrete steps:
1. load-context - Prime, read issue, verify can proceed
2. branch-setup - Clean feature branch, rebased on main
3. implement - Do work, commit regularly, file discovered work
4. self-review - Review diff, fix issues before testing
5. run-tests - ALL tests must pass, verify coverage
6. cleanup-workspace - No uncommitted, no stash, no cruft
7. close-issue - bd close with summary
8. signal-complete - POLECAT_DONE mail, WAIT for termination
Also updated mol-polecat-lease.formula.toml (v2):
- 5 steps: boot → working → verifying → merge_requested → done
- Aligns with witness patrol and mail protocol
- Clear verification criteria before MERGE_READY
Added templates/polecat-CLAUDE.md:
- Polecat role context for spawned workers
- Propulsion principle, key commands, completion protocol
- Clear "do NOT" section (don't exit, don't push to main)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>