Commit Graph

1120 Commits

Author SHA1 Message Date
Steve Yegge
2e4d247f7d fix(mayor): remove respawn loop from mayor attach
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>
2025-12-19 15:30:13 -08:00
Steve Yegge
06d8963318 fix(crew): improve Claude detection and add auto-prime hook
- 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>
2025-12-19 15:28:14 -08:00
Steve Yegge
479baec64a feat(beads): update ReadyWithType to use bd --type flag (gt-ktf3)
Uses server-side filtering for merge-request type queries.
Also syncs beads updates from MQ swarm session.
2025-12-19 15:24:26 -08:00
Steve Yegge
f106752149 fix(crew): detect when already in target session, skip attach 2025-12-19 15:09:07 -08:00
Steve Yegge
8c51347b7c bd sync: closed gt-3x1 and children 2025-12-19 14:48:58 -08:00
Steve Yegge
e11bc92361 chore: sync beads after closing gt-3x1.4 2025-12-19 14:48:54 -08:00
Steve Yegge
7a6f87ebb7 feat(refinery): implement merge failure handling with labels and notifications
Add comprehensive failure handling for merge queue:
- Add FailureType enum with conflict, tests_fail, build_fail, flaky_test, push_fail
- Add handleFailure function that updates beads issue with labels and assignee
- Add notifyWorkerFailure for type-specific failure notifications
- Add retry logic for flaky tests (configurable via retry_flaky_tests)
- Add pushWithRetry with exponential backoff for transient push failures
- Add label support to beads UpdateOptions (AddLabels, RemoveLabels, SetLabels)

Failure actions by type:
- conflict: needs-rebase label, assign to worker
- tests_fail/build_fail: needs-fix label, assign to worker
- flaky_test: retry once, then treat as tests_fail
- push_fail: retry with backoff, needs-retry label

Closes gt-3x1.4

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 14:48:30 -08:00
Steve Yegge
a216092c38 feat(refinery): implement Beads-native merge queue processing (gt-3x1)
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>
2025-12-19 14:48:24 -08:00
Steve Yegge
8b853ac4d2 bd sync: merge queue swarm launched, molecules complete 2025-12-19 14:47:08 -08:00
Steve Yegge
959912b6d4 feat(refinery): implement merge execution with test and push retry (gt-3x1.3)
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>
2025-12-19 14:46:39 -08:00
Steve Yegge
f37cae33df bd sync: 2025-12-19 14:45:05 2025-12-19 14:46:36 -08:00
Steve Yegge
5e563564e3 chore: sync beads after gt-vc1n close 2025-12-19 14:26:47 -08:00
Steve Yegge
4d0492fdf6 feat(tmux): add per-rig color themes and dynamic status line (gt-vc1n)
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>
2025-12-19 14:17:39 -08:00
Steve Yegge
e859938545 feat(polecat): add beads environment and sync for worktrees
CRITICAL FIX: Polecats (git worktrees) now get proper beads environment:
- BEADS_DIR: Points to rig canonical beads directory
- BEADS_NO_DAEMON=1: Prevents daemon from corrupting worktree beads
- BEADS_AGENT_NAME: Identity for beads conflict resolution

Also adds:
- bd sync on spawn (before and after issue assignment)
- bd sync on session stop (before killing)
- gt polecat sync command for manual beads sync
- Polecat role prompt explaining two-level beads architecture
2025-12-19 13:11:03 -08:00
Steve Yegge
8f1b7b0bc6 feat: add crew worker identity context for max
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>
2025-12-19 12:57:02 -08:00
Steve Yegge
8de4010d2c Merge polecat/Dementus: harness design documentation (gt-cr9) 2025-12-19 12:50:46 -08:00
Steve Yegge
9e66f1880c Merge polecat/Smeg: document harness concept (gt-1j6)
Kept existing harness.md from main as it is more comprehensive.
Polecat/Smeg version was redundant.
2025-12-19 12:45:42 -08:00
Steve Yegge
95ba8fcb6b fix(tmux): add debounce to SendKeys to prevent Enter racing paste
When sending keys via tmux send-keys, there is a race condition where the
Enter key can be processed before the pasted text completes. This causes
messages to appear in the prompt but not be submitted.

- Add SendKeysDebounced method with configurable delay between paste and Enter
- Update SendKeys to use 100ms default debounce
- Update Inject to scale debounce based on message size (100ms + 50ms/KB)

Fixes beads-62h
2025-12-19 01:57:02 -08:00
Steve Yegge
e993ba1aca Merge polecat/Bullet: ephemeral polecat model (gt-7ik)
Resolved conflict in spawn.go by keeping --polecat flag feature.
2025-12-19 01:55:21 -08:00
Steve Yegge
e799fe5491 fix: normalize mayor identity to 'mayor/' for mail routing
The addressToIdentity function was stripping the trailing slash from
'mayor/' addresses, causing a mismatch with beads messages that have
assignee 'mayor/'. This fix ensures mayor addresses always use 'mayor/'
for consistent mail routing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 23:30:24 -08:00
Steve Yegge
2edf2358dd fix: session start timing and MR type issues
- Add 200ms delay after NewSession before sending keys to fix race
  condition where shell is not ready (mayor.go, crew.go)
- Use merge-request type instead of task for gt mq submit (mq.go)

Fixes gt-tulx

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 22:17:13 -08:00
Steve Yegge
ce6fecbc57 bd sync: 2025-12-18 21:41:14 2025-12-18 21:41:14 -08:00
Steve Yegge
4fb0d55975 bd sync: 2025-12-18 21:32:17 2025-12-18 21:32:17 -08:00
Steve Yegge
1229b98bdf fix(tmux): add debounce delay between paste and Enter
Fixes race condition where Enter key arrives before paste is fully
processed, causing workers to sit idle at prompts.

- SendKeys now uses 100ms default debounce
- New SendKeysDebounced allows configurable delay
- Inject scales delay 100-500ms based on message size

Closes: gt-w3bu

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 21:08:23 -08:00
Steve Yegge
bc8e7e66ea Merge polecat/Coma: gt mq status + Engineer main loop 2025-12-18 20:49:46 -08:00
Steve Yegge
4685308393 bd sync: close gt-svi.3, gt-3x1.1 2025-12-18 20:44:50 -08:00
Steve Yegge
784c0582b5 Merge polecat/Ace: mq list + mq reject commands
Combined with Dag's mq retry from previous merge.
Full MQ CLI now includes: list, retry, reject subcommands.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 20:23:26 -08:00
Steve Yegge
884045f031 beads: sync closed issues from workers 2025-12-18 20:18:46 -08:00
Steve Yegge
14abb8dfae Pivot molecules from YAML schema to Beads-native prose
- Closed gt-4nn.1 (YAML schema): molecules should be Beads issues
- Updated gt-4nn epic: type=molecule, prose-based step definitions
- Updated subtasks for transaction-based instantiation

AI agents parse prose natively - no rigid schemas needed.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 20:16:34 -08:00
Steve Yegge
915594c44c Add crew rename, pristine commands and status integration
- gt crew rename: Rename crew workspace (kills session, renames dir)
- gt crew pristine: Sync crew workspaces with git pull + bd sync
- gt status: Show crew workers per rig with 👤 indicator

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 19:20:41 -08:00
Steve Yegge
e91a15396b bd sync: 2025-12-18 19:02:39 2025-12-18 19:02:39 -08:00
Steve Yegge
47fc5062e7 beads: normalize dependency metadata 2025-12-18 18:51:28 -08:00
Steve Yegge
dc09b0987e feat: swarm worker spawning, mail routing improvements, beads sync 2025-12-18 18:49:54 -08:00
Steve Yegge
b760a3fe22 bd sync: 2025-12-18 18:44:02 2025-12-18 18:46:46 -08:00
Steve Yegge
21cf8b3b1b bd sync: 2025-12-18 18:32:36 2025-12-18 18:46:46 -08:00
Steve Yegge
87b069bd38 bd sync: 2025-12-18 18:18:39 2025-12-18 18:46:46 -08:00
Steve Yegge
e8c139c598 Add Beads as Universal Data Plane to architecture docs
- Document molecule concept (composable workflow beads)
- Add OS metaphor mapping (daemon=kernel, molecules=templates, etc.)
- Table of bead categories: work, mail, MR, molecules, timed, pinned, resources
- Created beads: gt-aqm (epic), gt-4nn (molecules), gt-caz/8h4/b3p (P2)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 18:12:38 -08:00
Steve Yegge
ed64ab44ff fix: use correct bd mail send syntax 2025-12-18 14:27:23 -08:00
Steve Yegge
cf895aaa11 feat: add gt handoff command for agent lifecycle
Implements the agent-side lifecycle request command (gt-gby):

- Detects agent role via GT_ROLE env, tmux session, or directory
- Pre-flight checks (git clean) before retirement
- Sends handoff mail to self for context preservation
- Sends lifecycle request to manager (daemon/ for Mayor/Witness)
- Sets requesting_cycle state and waits for retirement

Usage:
  gt handoff           # Role-appropriate default
  gt handoff --cycle   # Restart with handoff mail
  gt handoff --restart # Fresh restart
  gt handoff --shutdown # Terminate without restart

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 13:51:04 -08:00
Steve Yegge
7f29a048a5 chore: set version to 0.0.1
Starting fresh to avoid the Beads versioning mistake.

🤝 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 12:47:24 -08:00
Steve Yegge
5b39fa8bbd bd sync: 2025-12-18 12:31:19 2025-12-18 12:31:19 -08:00
Steve Yegge
6208f6659c bd sync: 2025-12-18 11:51:57 2025-12-18 11:51:57 -08:00
Steve Yegge
50f7351bf0 bd sync: 2025-12-18 11:51:20 2025-12-18 11:51:50 -08:00
Steve Yegge
815b62d2a3 docs: unify daemon and agent lifecycle protocol
- ONE daemon for all Gas Town (not per-rig)
- Daemon pokes Mayor and all Witnesses (heartbeat)
- Unified gt handoff command for all agent types
- Lifecycle hierarchy: daemon → mayor/witnesses, witness → polecats/refinery
- Context-aware defaults: polecats shutdown, others cycle

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 11:51:13 -08:00
Steve Yegge
730700c1ef bd sync: 2025-12-18 11:41:01 2025-12-18 11:41:01 -08:00
Steve Yegge
7d6f2dce6d bd sync: 2025-12-18 11:34:10 2025-12-18 11:35:59 -08:00
Steve Yegge
0947d0d04d Add 'gt git-init' command and --git flag for harness setup (gm-otp)
Adds git repository initialization for Gas Town harnesses:

1. New 'gt git-init' command for existing harnesses:
   - Creates comprehensive .gitignore for Gas Town
   - Initializes git repository if not present
   - Optionally creates GitHub repo with --github flag

2. New flags on 'gt install':
   - --git: Initialize git with .gitignore during install
   - --github=owner/repo: Create and push to GitHub repo
   - --private: Make GitHub repo private

The .gitignore properly excludes:
- Polecats and rig clones (recreated with gt spawn/rig add)
- Runtime state files (state.json, *.lock, registry.json)
- OS and editor files

And tracks:
- Role contexts (CLAUDE.md)
- .beads/ configuration and issues
- hop/ directory

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 11:35:59 -08:00
Steve Yegge
691971a16a feat: crew attach auto-detection, worktree polecats, beads mail
- gt crew at: auto-detect crew from cwd, run gt prime after launch
- Polecats now use git worktrees from refinery (faster than clones)
- Updated architecture.md for two-tier beads mail model
- Town beads (gm-*) for Mayor mail/coordination
- Rig .beads/ symlinks to refinery/rig/.beads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 19:51:36 -08:00
Steve Yegge
41609e8def feat: add gt rig add command with container-based structure
- Implement AddRig with container-based approach (rig root is NOT a clone)
- Create internal/cmd/rig.go with add/list/remove subcommands
- Clone repo into refinery/rig/, mayor/rig/, crew/main/
- Initialize rig-level .beads/ with derived prefix
- Update docs/architecture.md to match implementation
- File gt-jpt epic for town-level beads redesign

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 19:14:37 -08:00
Steve Yegge
f7b0c11157 Merge polecat/Toast: doctor framework (gt-f9x.4)
Adds health check framework with Check interface, Doctor runner,
and gt doctor CLI command.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-12-17 16:14:26 -08:00