Add explicit "Run gt prime" to the crew resume prompt and mention
checking in-progress issues for better context recovery.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update gt-5af with full Deacon design (AI agent, not just Go daemon)
- Create 8 implementation tasks as children of gt-5af
- Add AGENTS.md for agent onboarding
- Fix crew restart timing (add debounce, delay for Claude init)
- Add SendKeysDelayedDebounced to tmux for better prompt injection
Deacon will monitor Mayor/Witnesses proactively and handle lifecycle
requests from Mayor/Witnesses/Crew reactively.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add delivery modes to mail messages:
- queue (default): message stored for periodic checking
- interrupt: inject system-reminder directly into session
New features:
- --interrupt flag on gt mail send for urgent/lifecycle messages
- --quiet flag on gt mail check for silent non-blocking checks
- gt mail wait command to block until mail arrives (with optional timeout)
Interrupt delivery injects a system-reminder via tmux send-keys,
useful for stuck detection, nudges, and urgent notifications.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement reusable name pool for polecat workers:
- Pool of 50 names (polecat-01 through polecat-50)
- Prefers lower-numbered slots for allocation
- Overflow uses rigname-N format when pool exhausted
- Pool names are reusable, overflow names are not
- State persisted to .gastown/namepool.json
Changes:
- Add NamePool type with Allocate/Release/Reconcile
- Integrate with polecat.Manager (auto-loads/saves)
- Update gt spawn to use AllocateName() from pool
- Remove legacy polecatNames list and generatePolecatName()
- Add comprehensive tests for name pooling
Benefits:
- Tmux sessions survive polecat restarts (same name)
- Users can stay attached and see work continue
- Bounded resource usage for common case
- Scales beyond 50 with overflow naming
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Before killing an agent session, the daemon now verifies that the
agent has set requesting_<action>=true in its state.json file.
This ensures agents have completed pre-shutdown tasks (git clean,
handoff mail, etc) before being terminated.
- Added verifyAgentRequestingState() for state file verification
- Added identityToStateFile() to map identity to state.json path
- Added comprehensive tests in lifecycle_test.go
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace tmux session scanning with proper rig discovery:
- Primary: Load rigs from mayor/rigs.json via rig manager
- Fallback: Scan town directory for .beads or config.json
- Handle rigs without running witnesses gracefully
Closes gt-oc2
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The ListOptions struct defaults Priority to 0 (Go zero value), which
caused bd list to filter to only P0 merge requests. This fix explicitly
sets Priority: -1 to disable priority filtering.
Root cause: beads.ListOptions{Type: "merge-request"} created opts with
Priority=0, passing --priority=0 to bd, filtering out P1-P4 MRs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive unit tests for:
- Config and state serialization (DefaultConfig, LoadState, SaveState)
- Session name pattern matching (isWitnessSession)
- Lifecycle request parsing (parseLifecycleRequest)
- Identity to session mapping (identityToSession)
Tests document a bug where parseLifecycleRequest always matches 'cycle'
because "LIFECYCLE:" prefix contains "cycle". Filed as gt-rixa.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement step recovery mechanism for stuck molecule steps (MVP):
- Add Release() and ReleaseWithReason() to beads wrapper
- Create gt release command to move in_progress → open
- Clears assignee so step can be claimed by another worker
- Optionally adds reason as note for tracking
Usage:
gt release <id> # Release single issue
gt release <id> -r "why" # Release with reason
This enables nondeterministic idempotence - stuck steps can be
safely recovered and retried by releasing and reclaiming.
Closes gt-g44u.4
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a new doctor check that detects when issues.db is empty but
issues.jsonl has content. This situation can cause "table issues has
no column named pinned" errors when running bd mail send.
The check:
- Detects empty database file alongside non-empty JSONL
- Can auto-fix by deleting the empty database and triggering rebuild
- Works for both town-level and rig-level beads
Run 'gt doctor --fix' to automatically fix this issue.
Fixes gt-bxi8
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a single-step molecule for building and installing the gt binary.
The molecule contains one step:
- install: Build with `go build -o gt ./cmd/gt` and install with
`go install ./cmd/gt`
Added InstallGoBinaryMolecule() function and test.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add detailed Molecules section to architecture.md covering:
- Core concepts (molecule, atom, bond, polymer, instance)
- Prose-based format with ## Step: definitions
- Composition via Includes directive
- Nondeterministic idempotence explanation
- Step states and recovery mechanism
- Built-in molecules (engineer-in-box, quick-fix, research)
- Molecule vs template distinction
- Create vision.md capturing the broader strategic vision:
- Git as blockchain foundation
- Work as universal protocol
- Entity chains (work history = CV)
- Skill vectors and capability matching
- Federation and world chain concept
- The OS metaphor for work
- Phase roadmap from v1 to platform of platforms
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The while true loop didn't work properly. Now gt mayor attach just runs claude directly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- IsClaudeRunning: remove UI marker check that caused false positives
when Claude output remained in scrollback after exit
- Add .claude/settings.json with SessionStart hook for gt prime
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When `gt crew at` detects Claude has exited (shell running), or when
`gt crew restart` is used, now sends a crew-specific prompt after priming:
"Read your mail, act on anything urgent, else await instructions."
This gives crew workers clear direction on resume without requiring
manual prompting.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements the 'gt mq integration land <epic>' command that merges an
integration branch to main.
Features:
- Verifies all MRs targeting integration branch are merged (unless --force)
- Merges with --no-ff for clear merge commit
- Runs tests before push (unless --skip-tests)
- Deletes integration branch (local and remote)
- Closes epic with merge commit info
- Rollback on test/push failure
- Dry-run mode (--dry-run)
Also adds to git package:
- MergeNoFF: merge with --no-ff flag
- DeleteRemoteBranch: delete branch on origin
- Reset: reset HEAD with optional --hard
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace branch discovery with Beads queue in Engineer:
- ProcessMR: full merge execution (fetch, conflict check, merge, test, push)
- handleSuccess: close MR and source issue, notify worker
- handleFailure: reopen MR, assign to worker, send failure notification
- Helper functions: gitRun, gitOutput, runTests, pushWithRetry, checkConflicts
The Engineer now:
- Polls for merge-requests via bd ready --type=merge-request
- Claims MRs by setting status to in_progress
- Processes merges with conflict detection and test execution
- Closes MRs and source issues on success
- Assigns back to workers on failure with appropriate notifications
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement success handling for the merge queue Engineer:
- Add handleSuccess method that handles successful merge completion
- Update MR body with merge_commit SHA and close_reason
- Close MR with 'merged' reason
- Close source issue with reference to MR ID
- Delete source branch if delete_merged_branches is configured
- Add DeleteRemoteBranch method to git package
- Add git client to Engineer struct
- Add tests for new functionality
Closes gt-3x1.5
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement the actual merge execution in Engineer.ProcessMR:
- ExecuteMerge function: checkout target, merge with --no-ff, run tests
- pushWithRetry: exponential backoff retry logic (3 retries, 1s base delay)
- runTests: execute configurable test command
- gitRun/gitOutput: helper methods for git operations
When tests fail, resets to HEAD~1 before returning failure.
When push fails after retries, resets to HEAD~1 before returning failure.
Conflict detection during merge triggers automatic merge --abort.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds the gt molecule seed subcommand that creates built-in molecule
definitions (engineer-in-box, quick-fix, research) in the beads database.
- Brings molecule.go from main (with list, show, parse, instantiate, instances)
- Adds builtin_molecules.go with 3 built-in workflow templates
- SeedBuiltinMolecules() writes directly to JSONL to bypass bd CLI type validation
- Molecules use well-known IDs (mol-engineer-in-box, mol-quick-fix, mol-research)
- Command is idempotent - skips molecules that already exist
Note: bd CLI does not yet support molecule as a valid issue type.
Filed beads-1 to add molecule type support. Until then, use bd --no-db.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add tmux status bar theming for Gas Town sessions:
- Per-rig color themes auto-assigned via consistent hashing
- 10 curated dark themes (ocean, forest, rust, plum, etc.)
- Special gold/dark theme for Mayor
- Dynamic status line showing current issue and mail count
- Mayor status shows polecat/rig counts
New commands:
- gt theme --list: show available themes
- gt theme apply: apply to running sessions
- gt issue set/clear: agents update their current issue
- gt status-line: internal command for tmux refresh
Status bar format:
- Left: [rig/worker] role
- Right: <issue> | <mail> | HH:MM
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updated CLAUDE.md to include:
- Crew worker role and identity (gastown/max)
- Gas Town architecture diagram showing crew position
- Key commands for mail, beads, and work management
- Session end checklist with handoff protocol
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement 'gt mq integration status <epic>' command that displays:
- Integration branch name and creation date
- Commits ahead of main
- Merged MRs (closed, targeting integration branch)
- Pending MRs (open, targeting integration branch)
Also adds git helpers for BranchCreatedDate and CommitsAhead.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The rig-level mermaid diagram incorrectly labeled polecats as git clone
when they are actually git worktrees from Mayor's clone. This now matches
the ASCII diagram which correctly describes them as worktrees.
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace polecat state.json with beads assignee field for state management:
- Remove state.json read/write from polecat.Manager
- Add loadFromBeads() to derive state from issue.assignee field
- Update AssignIssue() to set issue.assignee in beads
- Update ClearIssue() to clear assignee from beads
- Update SetState() to work with beads or gracefully degrade
- Add ListByAssignee and GetAssignedIssue to beads package
- Update spawn to create beads issues for free-form tasks
- Update tests for new beads-based architecture
State derivation:
- Polecat exists: worktree directory exists
- Polecat assigned: issue.assignee = 'rig/polecatName'
- Polecat working: issue.status = open/in_progress
- Polecat done: issue.status = closed or no assignee
Fixes: gt-qp98
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When 'gt mq submit' is called:
1. Parse source issue from branch
2. Check if issue has a parent epic
3. Check if integration/<epic> branch exists
4. If yes: set target=integration/<epic>
5. If no: set target=main
The --epic flag still works for explicit targeting.
Closes gt-h5n.7
🤝 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix ~50 errcheck warnings across the codebase:
- Add explicit `_ =` for intentionally ignored error returns (cleanup,
best-effort operations, etc.)
- Use `defer func() { _ = ... }()` pattern for defer statements
- Handle tmux SetEnvironment, KillSession, SendKeysRaw returns
- Handle mail router.Send returns
- Handle os.RemoveAll, os.Rename in cleanup paths
- Handle rand.Read returns for ID generation
- Handle fmt.Fprint* returns when writing to io.Writer
- Fix for-select with single case to use for-range
- Handle cobra MarkFlagRequired returns
All tests pass. Code compiles without errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements per-agent backoff tracking to reduce noise for busy agents:
- AgentBackoff type tracks interval, miss count, and last activity
- BackoffManager manages state across all agents
- Geometric backoff strategy (1.5x factor, 10min cap)
- Integrates with keepalive to skip pokes when agents are fresh
- Resets backoff immediately when activity detected
Closes gt-8bx
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>