New commands:
- `gt up` - Idempotent boot command that brings up all services:
Daemon, Deacon, Mayor, and Witnesses for all rigs
- `gt down` - Graceful shutdown of all services
Doctor improvements:
- New daemon check verifies daemon is running
- Fixable with `gt doctor --fix` to auto-start daemon
The system can run degraded (any services down) but `gt up` ensures
a fully operational Gas Town with one idempotent command.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Robustness improvements for the Deacon:
- Add DeaconTheme (purple/silver ecclesiastical theme)
- Apply theme to deacon sessions like mayor/witness
- Daemon now auto-starts deacon if not running
- Daemon pokes deacon instead of directly poking mayor/witnesses
- Deacon is responsible for monitoring mayor and witnesses
The daemon is a "dumb scheduler" that keeps the deacon alive.
The deacon (Claude agent) has the intelligence to understand
context and take remedial action when agents are unhealthy.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds documentation for the critical pileup processing protocol:
- Process ONE branch at a time
- Rebase each on current main before merging
- Push immediately after each merge
- Main moves forward, next branch must rebase on NEW main
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updated crew manager's createClaudeMD() to use the templates package
instead of hardcoded content. This ensures crew workers get the
comprehensive crew.md.tmpl context instead of a minimal stub.
Changes:
- Import templates package in crew/manager.go
- createClaudeMD now renders crew template with proper RoleData
- Added createClaudeMDFallback for graceful degradation
- Fallback uses correct gt commands instead of outdated town commands
The crew.md.tmpl template provides:
- Full Gas Town architecture explanation
- Crew-specific responsibilities and differences from polecats
- Complete command reference with gt/bd commands
- Session cycling and handoff instructions
- Context-aware workspace paths
Closes: gt-unrd
Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Refinery now runs as a Claude agent in a tmux session instead of
a Go-based polling loop. This aligns it with how polecats work and
enables intelligent MR processing.
Changes:
- Modified refinery.Start() to spawn Claude session (not gt refinery --foreground)
- Added gt refinery attach command for interactive access to refinery session
- Updated refinery.md.tmpl with comprehensive Claude agent instructions
- Added startup directive in gt prime for refinery role
The --foreground mode is preserved for backwards compatibility but the
default behavior now launches a Claude agent that can review diffs,
run tests, handle conflicts, and notify workers via mail.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds a popup menu showing core Gas Town agents (Mayor, Deacon,
Witnesses, Refineries, Crew) grouped by rig with color coding.
Polecats are hidden by default (use -a to include).
Usage:
gt agents - show popup menu
gt agents list - text output
gt ag -a - include polecats
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace @AGENTS.md with stub AGENTS.md
- Stub redirects to CLAUDE.md for full context
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rewrite vision.md with enterprise cognitive processing framing
- Expand README with comprehensive project overview
- Remove internal strategic references from merge-queue-design.md
- Position Gas Town as "IDE of 2026" for AI agent orchestration
Key messaging:
- Enterprise-grade cognitive processing machine
- Molecules as structured workflow guardrails
- Nondeterministic idempotence for crash recovery
- Beads as unified control/data plane
- Hierarchical auditability and observability
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The spawn command and polecat manager were incorrectly looking for beads
in <rig>/mayor/rig/.beads instead of <rig>/.beads. This caused:
- `gt spawn --issue ga-xxp` to fail with "no issue found" even when
`bd show ga-xxp` worked from the rig directory
- Polecats couldn't find rig-level issues (with ga- prefix) because
mayor/rig has a different beads database (with gt- prefix)
This fix:
- spawn.go: Use r.Path instead of filepath.Join(r.Path, "mayor", "rig")
- polecat/manager.go: Use r.Path for beads.New() initialization
- session/manager.go: Use r.Path/.beads for BEADS_DIR environment
Closes beads-2nh
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Convert the Witness from a Go polling loop to a Claude agent with:
- Enhanced witness.md.tmpl with detailed agent instructions:
- Startup protocol for checking handoffs and polecat status
- Lifecycle request processing (verify git state, cleanup)
- Health check protocol for detecting stuck polecats
- Nudge protocol with 3-strike escalation
- Escalation protocol for unresolvable issues
- Session cycling with handoff mail
- Updated gt witness attach to:
- Create sessions in <rig>/witness/ directory for proper role detection
- Ensure witness directory exists
- Added startup directive for Witness role in gt prime
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Refinery now runs as a Claude agent in a tmux session instead of
a Go-based polling loop. This aligns it with how polecats work and
enables intelligent MR processing.
Changes:
- Modified refinery.Start() to spawn Claude session (not gt refinery --foreground)
- Added gt refinery attach command for interactive access to refinery session
- Updated refinery.md.tmpl with comprehensive Claude agent instructions
- Added startup directive in gt prime for refinery role
The --foreground mode is preserved for backwards compatibility but the
default behavior now launches a Claude agent that can review diffs,
run tests, handle conflicts, and notify workers via mail.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements detailed polecat status display including:
- Lifecycle state (working, done, stuck, idle)
- Assigned issue
- Session status (running/stopped, attached/detached)
- Session creation time
- Last activity time with relative "ago" format
Also extends tmux.SessionInfo and session.Info to include
last activity timestamp from tmux session_activity.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove auto-ack on mail read so handoff messages persist
- Add STARTUP PROTOCOL directive for Mayor and Polecat roles
- Agents now get explicit instructions to check in on startup
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- gt spawn now sends work assignment to polecat inbox instead of tmux injection
- Add --identity flag to gt mail inbox and gt mail check
- Add --force flag to gt spawn to override existing unread mail
- Update polecat template with startup protocol for reading inbox
- Fix pre-existing lint issue in start.go
The new flow is more reliable:
1. Spawn sends work assignment mail to polecat inbox
2. Polecat starts and runs gt prime
3. gt prime automatically runs gt mail check --inject
4. Polecat reads work assignment from inbox
Benefits:
- Persistence across session restarts
- No racing against Claude initialization
- Audit trail in beads
- Edge case handling for existing unread mail
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Defines the standard polecat work lifecycle molecule with 8 steps:
- load-context: Load context and verify assignment
- implement: Do the work, file discovered issues
- self-review: Review changes for bugs and issues
- verify-tests: Run tests, add new ones as needed
- rebase-main: Rebase against main
- submit-merge: Submit to merge queue
- update-handoff: Update handoff state
- request-shutdown: Request witness termination
This molecule enables nondeterministic idempotence for polecat work.
Crash recovery is automatic - restart reads molecule state and continues
from the last completed step.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix crew sessions missing theme application (ConfigureGasTownSession)
- Add theme persistence to .gastown/config.json
- gt theme <name> now saves to config
- gt theme apply reads from config, falls back to hash-based default
- Improve rig detection using GT_RIG env var and path parsing
- gt theme shows whether theme is configured or default
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Witnesses don't have git clones like other agents. The detection was
checking for witness/rig which doesn't exist. Now correctly checks for
witness/state.json which is created by AddRig.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Key additions:
- Explain that beads is BOTH data and control plane (intentional blur)
- Add 'Operational Molecules' section with mol-polecat-work, mol-rig-activate, mol-graceful-shutdown examples
- Emphasize 'nondeterministic idempotence' as THE key property enabling autonomous operation
- Show that molecules aren't just for work - they're for any multi-step cognitive process
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
gt shutdown --graceful sends ESC to all agents, requests handoff,
waits for them to save state (default 30s), then terminates.
Phases:
1. Send ESC to interrupt agents
2. Send shutdown message requesting handoff
3. Wait for agents to complete (configurable with --wait)
4. Kill all sessions in correct order
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Stops agents in the correct order:
1. Deacon first (so it doesn't restart others)
2. All polecats, witnesses, refineries, crew (gt-* sessions)
3. Mayor last
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Starts Deacon and Mayor in the correct order. Other agents
(Witnesses, Refineries, Polecats) start lazily as needed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Deacon now gets role-specific context plus shared beads/mail context
like all other roles.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
gt prime now internally runs:
- bd prime (beads workflow context)
- gt mail check --inject (mail injection)
This allows a single SessionStart hook to provide complete agent context.
Also added PreCompact and UserPromptSubmit hooks to settings.json.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Defines a multi-step workflow for bootstrapping a new Gas Town installation:
- locate-harness: Interactive harness location selection
- create-harness: Directory structure creation
- setup-rigs: Rig configuration and cloning
- build-gt: Go binary compilation
- install-paths: PATH configuration
- init-beads: Beads database initialization
- sync-beads: Remote sync and doctor fixes
- verify: Installation verification
Note: Requires bd to support 'molecule' issue type (see gt-qn4l)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Creates deacon.md.tmpl for the health-check orchestrator role:
- Architecture position (between daemon and Mayor/Witnesses)
- Wake cycle instructions (heartbeat, mail check, health scan)
- Session patterns for all agent types
- Lifecycle request handling (cycle, restart, shutdown)
- Responsibilities and escalation protocols
Updates templates package to include deacon in role list.
Closes: gt-5af.1
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Documents the full process for bootstrapping a Gas Town from a harness
repository, including Go installation, gt binary build, rig population,
and beads initialization.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add deacon/ as a town-level mail identity alongside mayor/.
Both addressToIdentity() and identityToAddress() now handle
deacon/deacon/ consistently with trailing slash preservation.
Tested with bd mail send deacon/ and bd mail inbox --identity deacon/
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add deacon package with heartbeat read/write helpers:
- Heartbeat struct with Timestamp, Cycle, LastAction, health counts
- WriteHeartbeat/ReadHeartbeat for persistence to deacon/heartbeat.json
- IsFresh/IsStale/IsVeryStale for age checks
- ShouldPoke to determine if daemon should wake the Deacon
- Touch/TouchWithAction convenience functions
The Deacon writes heartbeat on each wake cycle. The Go daemon reads it
to decide whether to poke the Deacon (only if very stale >5 minutes).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update all code and documentation to use deacon/ instead of daemon/
for lifecycle mail targets:
- internal/cmd/handoff.go: getManager() returns deacon/ for Mayor/Witness
- internal/daemon/lifecycle.go: ProcessLifecycleRequests uses deacon/ inbox
- docs/architecture.md: update all references in lifecycle docs
- scripts/mayor-respawn-daemon.sh: use BD_IDENTITY=deacon for mail commands
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add CLI commands for managing the Deacon session, following the same
pattern as the Mayor commands:
- gt deacon start: Start the Deacon tmux session
- gt deacon stop: Stop the session with graceful shutdown
- gt deacon status: Check if session is running
- gt deacon attach: Attach to session (auto-starts if needed)
- gt deacon restart: Restart Claude within the session
The Deacon is the hierarchical health-check orchestrator that monitors
Mayor and Witnesses, handles lifecycle requests, and keeps Gas Town running.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>