Commit Graph

1638 Commits

Author SHA1 Message Date
Steve Yegge
fd08d7a860 fix: Purge 1653 tombstones via bd compact --purge-tombstones 2025-12-28 23:43:02 -08:00
Steve Yegge
b32eb0f9b8 chore: cleanup 1653 old tombstones to reduce issue count 2025-12-28 23:27:02 -08:00
Steve Yegge
00c7980185 chore: Clean orphaned dependencies 2025-12-28 22:50:42 -08:00
Steve Yegge
5c59e43ad3 chore: Purge 1676 tombstones from issues.jsonl 2025-12-28 22:49:10 -08:00
Steve Yegge
3df25d5e79 bd sync: 2025-12-28 22:41:22 2025-12-28 22:41:22 -08:00
Steve Yegge
76b53d9bbc bd sync: 2025-12-28 22:41:17 2025-12-28 22:41:17 -08:00
Steve Yegge
344b8098b4 bd sync: 2025-12-28 22:30:19 2025-12-28 22:30:19 -08:00
Steve Yegge
cff4c5c133 bd sync: 2025-12-28 22:30:07 2025-12-28 22:30:07 -08:00
Steve Yegge
72b5c05d65 Refactor gt swarm to use beads backing (gt-kc7yj.1)
Replace .runtime/swarms.json with beads-backed swarm tracking:

- gt swarm create: calls bd create --type=epic --mol-type=swarm
- gt swarm status: calls bd swarm status
- gt swarm list: calls bd list --mol-type=swarm --type=epic
- gt swarm start: uses bd swarm status to find ready tasks
- gt swarm land: checks completion via bd, closes epic
- gt swarm cancel: closes epic with cancelled reason

Removed:
- SwarmStore type and LoadSwarmStore/Save functions
- Old spawnSwarmWorkers (replaced with spawnSwarmWorkersFromBeads)
- Unused helper functions (stateStyle, taskStateIcon, matchesStatus)

This implements "discovery over tracking" principle from swarm-architecture.md:
swarm state is now derived from beads epic/issue statuses rather than
maintaining separate state in .runtime/swarms.json.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 22:11:38 -08:00
Steve Yegge
90eeb0135d Add gt rig reboot command
Combines shutdown + boot for convenience when restarting patrol agents
after polecats complete work.

Usage:
  gt rig reboot gastown
  gt rig reboot beads --force

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 21:45:39 -08:00
Steve Yegge
a28a702dc5 bd sync: 2025-12-28 21:42:09 2025-12-28 21:42:09 -08:00
Steve Yegge
8976615ccb bd sync: 2025-12-28 21:39:03 2025-12-28 21:39:03 -08:00
Steve Yegge
b389388f39 Add mail display to gt status (gt-um4iu)
- Show unread mail count and first message subject for each agent
- Display format: "mail: 📬 N unread → Subject..."
- Only shows mail line when agent has unread messages
- Fix agent bead ID generation for global agents (mayor/, deacon/)

Example output:
  🏭 Refinery
     gt-refinery-gastown running
       hook: refinery Handoff
       mail: 📬 8 unread → MERGE_READY morsov

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 20:51:39 -08:00
Steve Yegge
8c19752432 Enhance gt status with detailed agent bead view (gt-um4iu)
- Show full agent bead ID for each agent (e.g., gt-crew-gastown-joe)
- Display hook/pinned work with bead ID and title
- Use role icons and section separators for clarity
- Fall back to hooks array when agent bead lacks hook_bead field

Example output:
  🎩 Mayor
     gt-mayor running
       hook: (none)

  ─── gastown/ ───────────────────────
  🏭 Refinery
     gt-refinery-gastown running
       hook: refinery Handoff

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 20:45:51 -08:00
Steve Yegge
2f354b1ef6 Enhance gt status with tree-style role hierarchy view (gt-um4iu)
- Use tree characters (├── └── │) for hierarchical display
- Group agents by role type (Witness, Refinery, Crew, Polecats)
- Add role icons (🎩 Mayor, 🔔 Deacon, 👁 Witness, 🏭 Refinery, 👷 Crew, 😺 Polecats)
- Show pinned work inline with truncation
- Fix unused import in polecat/manager.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 19:36:15 -08:00
Steve Yegge
7606bc884a feat: Add gt rig boot command to start witness and refinery
Inverse of 'gt rig shutdown'. Starts rig patrol agents:
- Checks tmux sessions to avoid duplicates
- Starts witness if not running
- Starts refinery if not running
- Reports what was started vs skipped

Also adds ProcessExists util function needed by witness/refinery managers.
2025-12-28 19:19:10 -08:00
Steve Yegge
cdbe5d0a1e bd sync: 2025-12-28 19:06:47 2025-12-28 19:06:47 -08:00
Steve Yegge
72721cb07f Merge rictus: polecat nuke 2025-12-28 18:45:45 -08:00
Steve Yegge
c94c3f462f Merge nux: process util 2025-12-28 18:45:36 -08:00
Steve Yegge
71968c6623 Merge ace: polecat focus 2025-12-28 18:45:24 -08:00
Steve Yegge
d72e86493e Merge morsov: AgentIdentity, session helpers 2025-12-28 18:45:14 -08:00
Steve Yegge
4e11b31855 bd sync: 2025-12-28 17:34:44 2025-12-28 17:34:44 -08:00
Steve Yegge
40cb3eb9fc Extract timing constants to constants package (gt-795e8)
Added 6 timing constants:
- ShutdownNotifyDelay (500ms)
- ClaudeStartTimeout (15s)
- ShellReadyTimeout (5s)
- DefaultDebounceMs (100)
- DefaultDisplayMs (5000)
- PollInterval (100ms)

Updated 7 files to use these constants instead of magic numbers.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 17:18:03 -08:00
Steve Yegge
3421fe9303 Remove dead code: splitLines loop, unused methods (gt-2g130)
- polecat.go: Remove unreachable first loop in splitLines (was using filepath.SplitList incorrectly)
- townlog/logger.go: Remove unused Event.JSON() method and json import
- lock/lock.go: Remove unused ErrStaleLock error variable
- refinery/manager.go: Remove unused getTestCommand() method

Note: witness.StatePaused is actually used by cmd/witness.go, not dead code.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 17:13:34 -08:00
Steve Yegge
f14483fc3f fix: Remove brackets from timestamp 2025-12-28 17:08:45 -08:00
Steve Yegge
56ae461f68 fix: Shorten timestamp to HH:MM in feed TUI 2025-12-28 16:46:17 -08:00
Steve Yegge
807c063085 polecat ace: Add SINGLE-TASK FOCUS section (gt-m61ew)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:42:22 -08:00
Steve Yegge
f0b23c50f1 polecat template: Add SINGLE-TASK FOCUS section (gt-m61ew)
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>
2025-12-28 16:42:14 -08:00
Steve Yegge
4f94ba2b6b Extract SupportedShells constant to constants package (gt-4u682)
- Added constants.SupportedShells for consistent shell list
- Updated 7 usages across start.go, crew_lifecycle.go, crew_helpers.go, tmux.go
- All tests pass

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:40:39 -08:00
Steve Yegge
bf7d28082f bd sync: 2025-12-28 16:40:31 2025-12-28 16:40:31 -08:00
Steve Yegge
7aa6a0a8c7 docs: Add best-effort design doc to keepalive package (gt-gcnnr)
Enhanced the package-level documentation to explain why all write
operations in the keepalive package silently ignore errors.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:40:04 -08:00
Steve Yegge
a4281da60b Merge origin/main 2025-12-28 16:39:26 -08:00
Steve Yegge
5e9ca4c618 Standardize warning output to use style.PrintWarning (gt-g6kor)
- Add PrintWarning helper in internal/style/style.go
- Update 35 warning message outputs across 16 files to use consistent format
- All warnings now display as "⚠ Warning: <message>" in yellow/bold

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:38:04 -08:00
Steve Yegge
e3ea9c2855 ZFC #10: Polecat self-reports cleanup status
Instead of Go code checking git state to decide if polecat removal is safe,
the polecat now self-reports its cleanup_status via its agent bead.

Changes:
- Add CleanupStatus field to AgentFields struct
- Update FormatAgentDescription and ParseAgentFields for cleanup_status
- Add UpdateAgentCleanupStatus function to beads package
- Update gt done to compute and report git cleanup status
- Update RemoveWithOptions to read cleanup_status from agent bead first,
  falling back to git check for backward compatibility

Valid cleanup_status values:
- clean: no uncommitted work
- has_uncommitted: has uncommitted changes
- has_stash: has stashed changes
- has_unpushed: has unpushed commits
- unknown: git check failed

This follows ZFC (Zero Figuring in Code) principles - the polecat is the
authority on its own state, not Go code inferring it from external signals.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:37:01 -08:00
Steve Yegge
b172fd4787 feat: Add rig infra cycling (witness ↔ refinery)
Extended the unified cycle system to include rig infrastructure sessions:
- Witness ↔ Refinery (per rig) now cycle with C-b n/p

Also moved SetCycleBindings into ConfigureGasTownSession so ALL Gas Town
sessions automatically get the unified cycle bindings. Removed redundant
individual calls from crew, mayor, and deacon startup code.

Cycle groups are now:
- Town: Mayor ↔ Deacon
- Crew (per rig): All crew members in same rig
- Infra (per rig): Witness ↔ Refinery

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:36:38 -08:00
Steve Yegge
bcf9994195 fix: Require Gas Town workspace for gt feed
Fail fast with clear error when run outside ~/gt instead of
hanging while bd tries to start.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:36:09 -08:00
Steve Yegge
d953aa19e3 refactor: Extract helpers from runStart in start.go (gt-tkbd5)
Reduced runStart from 126 lines to 48 lines by extracting:
- startCoreAgents: Mayor and Deacon session startup (28 lines)
- startRigAgents: Witness/Refinery startup for --all flag (37 lines)
- startConfiguredCrew: Auto-start configured crew members (29 lines)

No behavior change - all existing tests pass.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:35:45 -08:00
Steve Yegge
17b892b196 fix: Code review fixes for TUI feed
- Return *Model from NewModel() so SetEventChannel works
- Use sync.Once for safe channel close on quit
- Use pointer receivers consistently throughout
- Capture channels in closure to prevent race
- Fix indent panic in renderAgent when indent < 2
- Remove unused filterActive and err fields

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:33:47 -08:00
Steve Yegge
b68cbf582f refinery patrol: Reorder merge-push for reliable MERGED notification (gt-kfznm)
- Notifications now come immediately after push, before cleanup
- Added STOP HERE warning after push
- Made verification gate more emphatic
- Cleanup happens only after notifications confirmed

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:31:04 -08:00
Steve Yegge
4b1d488f14 fix: Make MERGED notification and MR close mandatory in refinery formula (gt-kfznm)
Updated mol-refinery-patrol.formula.toml:
- Added MR bead ID tracking to inbox-check MERGE_READY parsing
- Restructured merge-push into 3 clear steps with REQUIRED callouts
- Added Step 2: MERGED notification (DO NOT SKIP)
- Added Step 3: Close MR bead (DO NOT SKIP)
- Added verification checklist before proceeding
- Added generate-summary verification to catch missed notifications

This ensures refinery agents complete the full lifecycle and trigger
witness cleanup (gt polecat nuke) after merge.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:29:24 -08:00
Steve Yegge
72b93da9a7 bd sync: 2025-12-28 16:24:34 2025-12-28 16:24:50 -08:00
Steve Yegge
c7da650f94 feat: Add charmbracelet TUI for gt feed (gt-u7dxq)
- Add bubbletea and bubbles dependencies
- Create internal/tui/feed package with:
  - model.go: Main bubbletea model with agent tree and event stream
  - view.go: Rendering logic with lipgloss styling
  - keys.go: Vim-style key bindings (j/k, tab, /, q)
  - styles.go: Color palette and component styles
  - events.go: Event source from bd activity
- Update gt feed to use TUI by default (--plain for text mode)
- TUI features: agent tree by role, event stream, keyboard nav

Closes gt-be0as, gt-lexye, gt-1uhmj

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:24:28 -08:00
Steve Yegge
dcd996495a bd sync: 2025-12-28 16:23:33 2025-12-28 16:23:33 -08:00
Steve Yegge
fa79d06d0e Add AgentIdentity type for session name parsing (gt-ov2uv)
Create AgentIdentity type to parse and construct session names, replacing
duplicated logic in sling.go and handoff.go.

- Add internal/session/identity.go with AgentIdentity type
- ParseSessionName handles: mayor, deacon, witness, refinery, crew, polecat
- SessionName() reconstructs valid tmux session name
- Address() returns mail-style address (e.g., "gastown/crew/max")
- GTRole() returns GT_ROLE env var format
- Update sling.go:sessionToAgentID to use ParseSessionName
- Update handoff.go:sessionToGTRole to use ParseSessionName
- Add comprehensive unit tests with round-trip verification

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:23:15 -08:00
Steve Yegge
4cdbd574e7 Add internal/util/process.go with comment (gt-w41ln)
E2E polecat workflow test - created util package with process.go file.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:21:50 -08:00
Steve Yegge
a05b445bbe fix: Add polecat handling to sessionToAgentID (gt-giyhp)
The sessionToAgentID function was missing handling for polecat sessions,
causing gt sling to fail to update the agent bead's hook_bead field.

Before: gt-gastown-nux -> gt-gastown-nux (unchanged, no match)
After:  gt-gastown-nux -> gastown/polecats/nux (correct format)

This enables updateAgentHookBead to properly convert to the agent bead ID
(gt-polecat-gastown-nux) and update the hook_bead field, which is
required for agents to know they have work on their hook.

Found via E2E test (gt-j0gx2) - nux wasn't picking up slung work because
hook_bead was null despite the task being pinned.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:21:02 -08:00
Steve Yegge
e27e3b7221 bd sync: 2025-12-28 16:19:51 2025-12-28 16:19:51 -08:00
Steve Yegge
99a619ae09 fix: Add startup delay before nudging newly spawned polecats (gt-1dbcp)
Claude needs ~2 seconds to initialize before it can process nudges.
Without this delay, the initial "Work slung" message would arrive
before Claude was ready, causing the SessionStart hook not to fire.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:18:52 -08:00
Steve Yegge
11d86423ba witness patrol: nuke command already correct for MERGED handling
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:16:25 -08:00
Steve Yegge
a3e3f956b1 beads sync: Day 4.3, 4.4 and related closures
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:16:25 -08:00