Commit Graph

837 Commits

Author SHA1 Message Date
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
Steve Yegge
f74687486c Implement Witness handoff bead state persistence (gt-caih)
Add persistent state storage for Witness across wisp burns:
- Add WorkerState and WitnessHandoffState types
- Implement loadHandoffState/saveHandoffState for bead persistence
- Update getNudgeCount/recordNudge to use persistent state
- Add activity tracking integration into healthCheck

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:15:16 -08:00
Steve Yegge
cdc5664948 bd sync: 2025-12-23 00:12:16 2025-12-23 00:12:16 -08:00
Steve Yegge
40a4d2edb2 Implement Witness handoff bead state persistence (gt-caih)
Add persistent state storage for Witness across wisp burns:
- Add WorkerState and WitnessHandoffState types
- Implement loadHandoffState/saveHandoffState for bead persistence
- Update getNudgeCount/recordNudge to use persistent state
- Add activity tracking integration into healthCheck

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:11:56 -08:00
Steve Yegge
b285fef4ea bd sync: 2025-12-23 00:11:54 2025-12-23 00:11:54 -08:00
Steve Yegge
af61daa2ee bd sync: 2025-12-23 00:11:33 2025-12-23 00:11:33 -08:00
Steve Yegge
dfcd47c228 bd sync: 2025-12-23 00:11:18 2025-12-23 00:11:28 -08:00
Steve Yegge
09b24cb975 bd sync: 2025-12-23 00:09:07 2025-12-23 00:11:28 -08:00
Steve Yegge
bae710ca26 bd sync: 2025-12-23 00:08:47 2025-12-23 00:11:28 -08:00
Steve Yegge
10a5d88958 bd sync: 2025-12-23 00:08:26 2025-12-23 00:11:28 -08:00
Steve Yegge
8d935093b3 bd sync: 2025-12-23 00:02:55 2025-12-23 00:11:28 -08:00
Steve Yegge
ab73cee853 bd sync: 2025-12-23 00:02:35 2025-12-23 00:11:28 -08:00
Steve Yegge
a52353c202 bd sync: 2025-12-22 23:58:04 2025-12-23 00:11:28 -08:00
Steve Yegge
8bb0ad8e40 Close gt-j6s8: Refinery patrol auto-bond implemented 2025-12-23 00:11:07 -08:00
Steve Yegge
ef1f5ac2f3 Refinery startup: auto-bond mol-refinery-patrol on start
Add outputRefineryPatrolContext to gt prime that automatically spawns
the refinery patrol molecule when no active patrol is found. This ensures
the merge queue is always monitored when Refinery starts up.

Key changes:
- Add RoleRefinery to outputMoleculeContext
- Implement outputRefineryPatrolContext with auto-spawn logic
- Check for existing in-progress or open patrol molecules
- Spawn mol-refinery-patrol wisp if none found

(gt-j6s8)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:10:39 -08:00
Steve Yegge
66710aef69 bd sync: 2025-12-23 00:08:26 2025-12-23 00:08:26 -08:00
Steve Yegge
d30a428447 bd sync: 2025-12-23 00:02:55 2025-12-23 00:02:55 -08:00
Steve Yegge
21b3b626c8 bd sync: 2025-12-23 00:02:35 2025-12-23 00:02:35 -08:00
Steve Yegge
d9eecf864c Fix crew loadState to handle empty/incomplete state.json
When state.json contains empty JSON {}, the ClonePath and other fields
were left empty, causing "can't find pane/session" errors in gt crew at.
Now backfills essential fields (Name, Rig, ClonePath) if missing.

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

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