Commit Graph

855 Commits

Author SHA1 Message Date
Steve Yegge
42d8944f71 feat: default crew name to 'max', support town-level override
- Add DefaultCrewName constant ('max') to config package
- Add default_crew_name field to MayorConfig for town-level override
- Update gt rig add to resolve crew name: --crew flag > town config > default
- Update help text to reflect new default

Priority: --crew flag > MayorConfig.DefaultCrewName > config.DefaultCrewName ('max')
2025-12-23 04:47:07 -08:00
Steve Yegge
e9729a3225 docs: fix command name in account-management.md (gt crew at) 2025-12-23 04:38:27 -08:00
Steve Yegge
84c7d48ef4 feat: add crew, witness, refinery, mayor as sling targets
Adds support for slinging work to four new target types:

- crew (e.g., beads/crew/dave): Human-managed persistent workers
  - No worktree recreation
  - No auto-session start
  - Sends work assignment mail

- witness (e.g., gastown/witness): Per-rig lifecycle manager
  - Suggests --wisp for ephemeral work
  - Pins to witness hook

- refinery (e.g., gastown/refinery): Per-rig merge queue
  - Accepts protos, issues, and epics
  - Pins to refinery hook

- mayor (e.g., mayor/): Town-level coordinator
  - Uses town-level beads
  - Human-managed like crew
  - Sends work assignment mail

Updated help text with new target formats and examples.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 04:37:29 -08:00
Steve Yegge
8f2b324a9d bd sync: 2025-12-23 04:16:41 2025-12-23 04:17:04 -08:00
Steve Yegge
3ee23f5c63 fix: add missing gt account status command
The help text documented this subcommand but it wasn't implemented.
Adds status command showing currently resolved account with source
(GT_ACCOUNT env var or default).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 04:16:32 -08:00
Steve Yegge
ba2db2bc11 feat: implement account management for multi-account Claude Code (gt-3133)
Adds support for managing multiple Claude Code accounts in Gas Town:

- accounts.json config parsing in mayor/ directory
- gt account list/add/default commands
- GT_ACCOUNT env var support with priority resolution
- --account flag on gt spawn and gt crew at commands
- CLAUDE_CONFIG_DIR injection into tmux sessions

Priority order: GT_ACCOUNT env var > --account flag > default from config

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 04:05:14 -08:00
Steve Yegge
a9ee102606 bd sync: 2025-12-23 04:04:38 2025-12-23 04:04:38 -08:00
Steve Yegge
5f2e16f789 refactor: remove shell respawn loops from witness and deacon (gt-zxgu)
Shell loops bypassed the proper lifecycle architecture. Now:

- Witness: Launches Claude directly, daemon/deacon health-scan handles restart
- Deacon: Launches Claude directly, daemon detects exit and restarts
- Daemon: ensureDeaconRunning() now checks if Claude is running (pane cmd)
         and restarts it if session exists but Claude has exited
- gt deacon restart: Now does stop+start instead of Ctrl-C

This enforces proper lifecycle flow through LIFECYCLE mail and daemon
heartbeat rather than bypassing it with shell loops.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 04:02:17 -08:00
Steve Yegge
46a5e38fa2 feat: add restart subcommands to witness and refinery (gt-9kc2)
- Add `gt witness restart <rig>` command (stop + start)
- Add `gt refinery restart [rig]` command (stop + start)
- Add self-cycling documentation to refinery template
- Clarify that restarts are daemon-managed, not shell loops

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 03:56:31 -08:00
Steve Yegge
d51fe0268d bd sync: 2025-12-23 03:48:18 2025-12-23 03:48:29 -08:00
Steve Yegge
13f68c20d9 docs: account management design for multi-account Claude Code (gt-3133)
Design doc for Gas Town account management feature enabling users to
switch between multiple Claude Code accounts (e.g., personal vs work).

Key decisions:
- Uses CLAUDE_CONFIG_DIR env var as core mechanism
- Config stored in ~/gt/mayor/accounts.yaml (follows town config pattern)
- NOT in Beads (config, not work items)
- NOT molecules (mechanical, not cognitive)
- Extensible for API keys, per-role defaults, federation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 03:39:58 -08:00
Steve Yegge
d118381cfc bd sync: 2025-12-23 03:39:46 2025-12-23 03:39:46 -08:00
Steve Yegge
389430f41d bd sync: 2025-12-23 03:24:54 2025-12-23 03:24:54 -08:00
Steve Yegge
44bbeb6c7c refactor: split builtin_molecules.go into category files (gt-nmtp)
Split 1620-line file into 4 organized files:
- builtin_molecules.go (77 lines) - type, registry, seeder
- molecules_patrol.go (567 lines) - Deacon, Witness, Refinery patrol
- molecules_work.go (446 lines) - EngineerInBox, QuickFix, Research, PolecatWork, ReadyWork
- molecules_session.go (545 lines) - CrewSession, PolecatSession, Bootstrap, VersionBump, InstallGoBinary

Benefits:
- Easier to find/edit specific molecules
- Smaller diffs on changes
- Clear categorization by purpose

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 02:44:28 -08:00
Steve Yegge
290c077ce4 bd sync: 2025-12-23 02:44:10 2025-12-23 02:44:10 -08:00
Steve Yegge
d059af2146 docs: Christmas Ornament pattern and activity feed vision
Added to molecular-chemistry.md:
- Dynamic Bonding section with Christmas Ornament pattern
- WaitsFor directive documentation
- Activity feed examples
- Variable substitution syntax
- Mol Mall integration notes

Added to architecture.md:
- Christmas Ornament pattern summary
- Activity feed section
- bd activity command documentation

This design enables mol-witness-patrol to dynamically bond
inspection arms per-polecat, with real-time work state visibility.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 02:39:25 -08:00
Steve Yegge
17021cbfd3 bd sync: 2025-12-23 02:14:46 2025-12-23 02:15:00 -08:00
Steve Yegge
9190d3ba08 docs: update vision.md phase terminology table (gt-62hm)
Updated the Steam Engine metaphor table to use consistent phase terminology:
- Proto = Solid (crystal) - frozen templates
- Mol = Liquid - flowing durable instances
- Wisp = Vapor (gas) - transient traces
- Digest = Distillate - compressed records

This aligns with the Core Innovation 3 section terminology.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 02:14:44 -08:00
Steve Yegge
be5509fb18 gt down --all: also kill tmux server 2025-12-23 02:04:17 -08:00
Steve Yegge
18fb0e05fe feat(handoff): add -s/-m flags for ergonomic handoff mail
Agents naturally expect `gt handoff -s "Subject" -m "Message"` to work
like `gt mail send`. Now it does:

- Added --subject/-s and --message/-m flags to gt handoff
- Added --self flag to gt mail send for sending to self
- Handoff auto-sends mail to self before respawning pane

This makes agent-initiated handoff more ergonomic - they can include
context in a single command instead of two separate steps.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 01:51:47 -08:00
Steve Yegge
5459e8e6b1 Deacon startup: auto-bond mol-deacon-patrol on gt prime
- Add auto-spawn logic to outputDeaconPatrolContext()
- Deacon now auto-spawns mol-deacon-patrol if no active patrol
- All three patrol roles now have consistent auto-bond behavior:
  Deacon, Witness, Refinery

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 01:47:41 -08:00
Steve Yegge
3aff6e9021 bd sync: 2025-12-23 01:47:09 2025-12-23 01:47:09 -08:00
Steve Yegge
0dac49636c Witness startup: auto-bond mol-witness-patrol on gt prime (gt-lx3n)
- Add outputWitnessPatrolContext() function in prime.go
- Witness now auto-spawns mol-witness-patrol if no active patrol
- Fixed catalog ID parsing (strip trailing colon) for both witness and refinery
- Created mol-witness-patrol template with 10 steps (gt-qflq)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 01:43:49 -08:00
Steve Yegge
5a3e1a366e bd sync: 2025-12-23 01:19:57 2025-12-23 01:43:49 -08:00
Steve Yegge
78507ff326 refactor(cmd): split molecule.go into focused files
Split the 1929-line molecule.go into 5 focused files:
- molecule.go (376): command definitions, init(), loadMoleculeCatalog
- molecule_status.go (673): status, progress, current commands
- molecule_list.go (432): list, show, export, parse, instances
- molecule_lifecycle.go (359): instantiate, catalog, burn, squash
- molecule_attach.go (128): attach, detach, attachment

No functional changes - pure refactoring for maintainability.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 01:38:34 -08:00
Steve Yegge
d8079ffd57 Merge remote-tracking branch 'origin/polecat/nux' 2025-12-23 01:15:57 -08:00
Steve Yegge
8455351641 Merge remote-tracking branch 'origin/polecat/furiosa' 2025-12-23 01:15:55 -08:00
Steve Yegge
8e3beda87c Merge remote-tracking branch 'origin/polecat/dementus' 2025-12-23 01:15:54 -08:00
Steve Yegge
49f37c3e6c Merge remote-tracking branch 'origin/polecat/immortan' 2025-12-23 01:15:53 -08:00
Steve Yegge
b15557ba37 Merge remote-tracking branch 'origin/polecat/rictus' 2025-12-23 01:15:51 -08:00
Steve Yegge
6e2d901213 Merge remote-tracking branch 'origin/polecat/valkyrie' 2025-12-23 01:15:50 -08:00
Steve Yegge
b3fa1f7edb feat: Add mol-ready-work protomolecule (cherry-pick from polecat/immortan)
Adds autonomous backlog processing patrol molecule for crew workers.
The molecule scans PRs, GitHub issues, and beads; selects work using
an ROI heuristic; executes items; and loops until context is low.

Key features:
- Vapor phase (wisp) - ephemeral patrol cycles
- Scans 4 backlogs: PRs > untriaged > beads > triaged
- ROI-based selection with context awareness
- Per-type execution handlers (PR review, triage, implementation)
- Clean handoff protocol with digest squashing

Original commit: 20e2a13 by immortan
Issue: gt-tnca.1

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 01:08:24 -08:00
Steve Yegge
37c2382767 Unify startup protocols: all roles use 'gt mol status' + RUN IT pattern
- Mayor/Crew: mol attached → RUN IT, else await instruction
- Witness/Refinery/Deacon: mol attached → RUN IT, else spawn patrol
- Polecat: mol attached → RUN IT, else ERROR (polecats must have work)
2025-12-23 01:05:48 -08:00
Steve Yegge
a3f2ceba5b fix: Use correct managers for refinery/witness auto-start in spawn (gt-bjft)
The previous implementation used session.Manager which only works for polecats.
Refinery and Witness have their own managers that handle their tmux sessions.

- Use refinery.Manager for refinery auto-start
- Use witness.Manager for witness auto-start
- Check state before starting to avoid duplicate starts

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 01:03:31 -08:00
Steve Yegge
6c323b0d1f Crew startup: 'RUN IT' instead of 'AUTO-CONTINUE' for clarity 2025-12-23 00:56:26 -08:00
Steve Yegge
8f721ec4e1 bd sync: 2025-12-23 00:54:51 2025-12-23 00:54:51 -08:00
Steve Yegge
5ea4a1de37 bd sync: 2025-12-23 00:17:58 2025-12-23 00:54:10 -08:00
Steve Yegge
33cdd623bc Witness: Verify POLECAT_DONE before stopping sessions (gt-ldk8)
- Add handling for POLECAT_DONE messages in processShutdownRequests()
- Track which polecats have signaled done (using SpawnedIssues with "done:" prefix)
- For LIFECYCLE:shutdown requests, wait for POLECAT_DONE before cleanup
- Add checkPendingCompletions() to nudge polecats with closed issues
- Add 10-minute timeout with force-kill after waiting for POLECAT_DONE
- Protects against losing MR submissions when Witness cleans up too early

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:54:10 -08:00
Steve Yegge
a3c671188f feat: Auto-start refinery/witness on spawn, add refinery check to Witness patrol (gt-bjft)
Implements redundant systems to ensure infrastructure stays operational:
- gt spawn: Auto-starts refinery and witness if not running
- mol-witness-patrol: Added check-refinery step to verify refinery is alive

This ensures polecats don't wait forever for merges.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:52:45 -08:00
Steve Yegge
67d7193c61 bd sync: 2025-12-23 00:48:18 2025-12-23 00:52:23 -08:00
Steve Yegge
9ae23a2bca Add crew-state and lifecycle-hygiene doctor checks
New checks:
- crew-state: Validates crew worker state.json files for completeness
  Can regenerate missing/invalid state files with --fix

- lifecycle-hygiene: Detects stale lifecycle state that can wedge the deacon
  - Stale lifecycle messages in deacon inbox
  - Stuck requesting_* flags in state.json when session is healthy
  Can clean up with --fix (external intervention when deacon is stuck)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:48:10 -08:00
Steve Yegge
a5a37f5d63 Fix: /handoff regression - use respawn-pane with direct claude command
Three related fixes:

1. lifecycle.go: Use gt mail delete instead of gt mail read to prevent
   lifecycle requests from accumulating.

2. handoff.go: Return exec claude command for respawn-pane instead of
   gt crew at which tries to attach to existing session.

3. handoff.md skill: Work without --cycle and -m flags, send mail separately.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:23:40 -08:00
Steve Yegge
f69c9e9d24 Add molecule format bridge: support child issues (gt-yd98)
InstantiateMolecule now supports two formats:
1. New format: If molecule has child issues, copy them as templates
2. Old format: If no children, parse markdown steps from Description

This unifies execution while preserving authoring flexibility.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:23:20 -08:00
Steve Yegge
441bafe7a8 bd sync: 2025-12-23 00:20:18 2025-12-23 00:20:18 -08:00
Steve Yegge
cdb206a685 bd sync: 2025-12-23 00:19:19 2025-12-23 00:19:42 -08:00
Steve Yegge
f517d876cd bd sync: 2025-12-23 00:15:48 2025-12-23 00:19:41 -08:00
Steve Yegge
1287aadeb8 bd sync: 2025-12-23 00:17:58 2025-12-23 00:17:58 -08:00
Steve Yegge
20e2a13dc4 feat: Add mol-ready-work protomolecule
Adds autonomous backlog processing patrol molecule for crew workers.
The molecule scans PRs, GitHub issues, and beads; selects work using
an ROI heuristic; executes items; and loops until context is low.

Key features:
- Vapor phase (wisp) - ephemeral patrol cycles
- Scans 4 backlogs: PRs > untriaged > beads > triaged
- ROI-based selection with context awareness
- Per-type execution handlers (PR review, triage, implementation)
- Clean handoff protocol with digest squashing

Issue: gt-tnca.1

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:17:49 -08:00
Steve Yegge
049dd13cd1 Witness: Verify POLECAT_DONE before stopping sessions (gt-ldk8)
- Add handling for POLECAT_DONE messages in processShutdownRequests()
- Track which polecats have signaled done (using SpawnedIssues with "done:" prefix)
- For LIFECYCLE:shutdown requests, wait for POLECAT_DONE before cleanup
- Add checkPendingCompletions() to nudge polecats with closed issues
- Add 10-minute timeout with force-kill after waiting for POLECAT_DONE
- Protects against losing MR submissions when Witness cleans up too early

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:17:35 -08:00
Steve Yegge
0b5fda69fd Add patrol awareness and wiring to gt rig add / gt doctor (gt-7923)
gt rig add changes:
- Seed patrol molecules (Deacon, Witness, Refinery) when adding rig
- Create plugin directories at town (~gt/plugins/) and rig levels
- Update command documentation and structure output

gt doctor changes:
- patrol-molecules-exist: Verify patrol molecules exist
- patrol-hooks-wired: Verify daemon triggers patrols
- patrol-not-stuck: Detect stale wisps (>1h in_progress)
- patrol-plugins-accessible: Verify plugin directories exist
- patrol-roles-have-prompts: Verify role prompts exist

All patrol checks support --fix where applicable.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:17:32 -08:00