Commit Graph

1496 Commits

Author SHA1 Message Date
Steve Yegge
58d3f3af52 feat: Add gt polecat nuke command for full cleanup (gt-z99nh)
Implements the nuclear cleanup option for post-merge polecat removal:
- Kills Claude session (force mode)
- Deletes git worktree (bypassing all safety checks)
- Deletes polecat branch
- Closes agent bead

Supports --all for bulk nuke and --dry-run for preview.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 14:17:21 -08:00
Steve Yegge
e3b9abb79b Update gt mol status to use hook slot from agent beads (gt-lisj6)
This change migrates gt mol status from querying by pinned status + assignee
to reading the hook_bead field from agent beads.

Changes:
- Add AgentBeadFields struct to parse agent bead description fields
- Add buildAgentBeadID function to convert identity to agent bead ID
- Update runMoleculeStatus to:
  1. First try to find the agent bead by ID
  2. Read hook_bead from agent bead description
  3. If hook_bead is set, fetch and display that bead
  4. Fall back to legacy pinned-query approach if no agent bead or hook

The implementation is backwards compatible - agents without agent beads
(like polecats before gt-rxa7v is completed) still work via the fallback.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 01:12:21 -08:00
Steve Yegge
a8ca0b1013 docs: Add warning about using gt nudge instead of tmux send-keys
Raw tmux send-keys doesn't work correctly with Claude's input handling.
gt nudge uses literal mode + debounce + separate Enter for reliable delivery.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 00:59:31 -08:00
Steve Yegge
9d09a1f540 fix: Make sling target path parsing more forgiving (gt-e0u3r)
Now accepts:
- gastown/nux (polecat shorthand)
- gastown/Nux (case-insensitive)
- gastown/polecats/nux (explicit path)
- gastown/crew/max (unchanged)
- gastown/witness (unchanged)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 00:54:27 -08:00
Steve Yegge
52b0d27d3e bd sync: 2025-12-28 00:46:52 2025-12-28 00:46:52 -08:00
Steve Yegge
a0ddbe22b0 docs: add mail protocol reference (gt-k294l)
Document inter-agent mail types:
- POLECAT_DONE, MERGE_READY, MERGED
- WITNESS_PING, HELP, HANDOFF

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 00:17:25 -08:00
Steve Yegge
4f95e33fe1 bd sync: agent beads created 2025-12-28 00:12:13 -08:00
Steve Yegge
a8145010d6 bd sync: 2025-12-28 00:08:31 2025-12-28 00:08:31 -08:00
Steve Yegge
19042c09b2 bd sync: 2025-12-28 00:03:29 2025-12-28 00:03:29 -08:00
Steve Yegge
2d05da9dcc bd sync: 2025-12-27 23:38:14 2025-12-27 23:38:14 -08:00
Steve Yegge
9c3f89a392 bd sync: 2025-12-27 22:17:30 2025-12-27 22:17:30 -08:00
Steve Yegge
eb73ed51ae bd sync: 2025-12-27 22:13:56 2025-12-27 22:13:56 -08:00
Steve Yegge
393d2fd689 bd sync: 2025-12-27 21:34:40 2025-12-27 21:34:48 -08:00
Steve Yegge
7cba83cac5 bd sync: 2025-12-27 20:09:39 2025-12-27 21:34:48 -08:00
Steve Yegge
879018f35d fix: gt commands follow .beads/redirect for shared beads (gt-ln5af)
Added ResolveBeadsDir() helper that follows .beads/redirect files,
enabling crew workers and polecats to properly access shared beads.

Updated callers:
- mailbox.go: NewMailboxFromAddress follows redirect
- catalog.go: LoadCatalog follows redirect at all levels
- doctor checks: beads_check, patrol_check, wisp_check follow redirect

Also added comprehensive tests for the redirect resolution logic.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 21:34:22 -08:00
Steve Yegge
f443cd6637 feat: Add routes-config check to gt doctor (gt-p3yhp)
Adds a new fixable doctor check that verifies beads routing configuration:
- Checks if routes.jsonl exists
- Verifies all rigs have routing entries (by path, not just prefix)
- Validates that routes point to valid locations with .beads directories
- Can auto-fix by adding missing routes with --fix

The check is smart about prefix mismatches: if a rig already has a route
by path (e.g., gastown/mayor/rig), it won't report it as missing even if
the prefix in rigs.json differs from what's in routes.jsonl.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 20:09:27 -08:00
Steve Yegge
e71e8676ae bd sync: 2025-12-27 20:02:37 2025-12-27 20:02:37 -08:00
Steve Yegge
45854106c2 bd sync: 2025-12-27 19:27:37 2025-12-27 19:27:37 -08:00
Steve Yegge
6b4c0e3a08 bd sync: 2025-12-27 19:19:15 2025-12-27 19:19:15 -08:00
Steve Yegge
8e337dad6a bd sync: 2025-12-27 19:13:31 2025-12-27 19:13:31 -08:00
Steve Yegge
6a053a767e Add CLI audit issues (gt-et72q, gt-tzogh, gt-361qj) 2025-12-27 18:21:03 -08:00
Steve Yegge
d4c076451c Fix gt mol status: cross-rig scanning for town-level roles (gt-4ol8f)
When mayor/deacon checks their hook from ~/gt, gt mol status now scans all
registered rigs for pinned beads. This ensures the propulsion principle works
regardless of which directory the agent starts in.

The scan uses routes.jsonl to find all rig beads directories.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 17:53:38 -08:00
Steve Yegge
2788996e74 Revert "Fix gt sling/hook: use Town beads for town-level roles (gt-4ol8f)"
This reverts commit ed9816015d.
2025-12-27 17:51:52 -08:00
Steve Yegge
ed9816015d Fix gt sling/hook: use Town beads for town-level roles (gt-4ol8f)
When slinging or hooking work to mayor/deacon, the pin now lands in Town
beads (~/.beads/) instead of rig beads. This ensures gt mol status finds
the pinned work when run from ~/gt.

The issue was that town-level roles operate from the town root, so their
hooks should be discoverable from there.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 17:46:43 -08:00
Steve Yegge
711515506c Fix witness template: use two-step pattern for wisp creation (gt-et72q)
The template incorrectly used --assignee flag on bd mol wisp which doesn't
exist. Changed to two-step pattern matching deacon template.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 17:34:24 -08:00
Steve Yegge
4730ac508f polecat: fresh unique branches per run, add gc command (gt-ake0m)
Changed polecat branch model to use unique timestamped branches
(polecat/<name>-<timestamp>) instead of reusing persistent branches.
This prevents JSONL drift issues where stale polecat branches don't
have recently created beads.

Changes:
- Add(): create unique branch, simplified (no reuse logic)
- Recreate(): create fresh branch, old ones left for GC
- loadFromBeads(): read actual branch from git worktree
- CleanupStaleBranches(): remove orphaned polecat branches
- ListBranches(pattern): new git helper for branch enumeration
- gt polecat gc: new command to clean up stale branches

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 17:19:02 -08:00
Steve Yegge
3aa0ba6e6b bd sync: 2025-12-27 17:12:47 2025-12-27 17:12:47 -08:00
Steve Yegge
921e57309b fix: gt crew next returns success for non-crew sessions (gt-1s89v)
When run in a non-crew session (Mayor, Witness, Refinery, Deacon),
gt crew next/prev now returns success (exit 0) instead of an error.

These sessions don't have cycle groups, so pressing C-b n should
simply do nothing rather than fail with an error message.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:48:26 -08:00
Steve Yegge
4934131272 bd sync: 2025-12-27 16:48:16 2025-12-27 16:48:16 -08:00
Steve Yegge
be8b98c9eb refactor: remove unused Beads.Pin/Unpin methods (bd-x0zl)
These methods called `bd pin` and `bd unpin` which have been removed.
Neither method was ever called - gt uses `bd update --status=pinned` instead.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:02:23 -08:00
Steve Yegge
3ae39f2eb0 Fix CLI mismatches from bd-2fs7 (wisp->ephemeral) (gt-pu1t5)
bd-2fs7 moved wisp/pour under bd mol, but gastown was not updated.
This caused handoff failures - gt mail send errored with 'unknown flag: --wisp'.

Changes:
- router.go: --wisp -> --ephemeral for bd create
- patrol_helpers.go: bd wisp create -> bd mol wisp create
- wisp_check.go: bd wisp gc -> bd mol wisp gc

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 15:01:02 -08:00
Steve Yegge
bebb7b0f61 bd sync 2025-12-27 14:50:35 -08:00
Steve Yegge
67e1b1b06e Add gt crew restart --all for batch crew restarts
- Add --all flag to restart all running crew sessions
- Add --dry-run flag to preview without restarting
- Add --rig filter to target specific rig
- Extract restartCrewSession helper for reuse

🤝 Filed gt-1kljv for adding tests

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:50:35 -08:00
Steve Yegge
95d45b3665 bd sync: 2025-12-27 14:47:27 2025-12-27 14:50:35 -08:00
Steve Yegge
dccb698d37 bd sync: 2025-12-27 14:35:47 2025-12-27 14:50:35 -08:00
Steve Yegge
7f77491080 docs: Clarify gt mol vs bd mol command distinction
Update reference.md to explain the separation:
- bd mol: beads data operations (list, show, pour, wisp, bond)
- gt mol: agent operations (status, current, attach, burn, squash)

Key clarification: gt mol burn/squash operate on current agent's
attached molecule (auto-detected), while bd mol burn/squash take
explicit molecule IDs.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:47:21 -08:00
Steve Yegge
888bc3ea74 refactor: Remove duplicate mol commands from gt (gt-w91xz)
Remove beads data operations from gt mol, delegating to bd:
- catalog → bd formula list
- list → bd mol list
- show → bd mol show
- parse → bd mol show
- instantiate → bd mol pour
- instances → bd queries
- bond → bd mol bond

Keep agent-specific operations:
- status, current, progress (agent context queries)
- attach, detach, attachment, attach-from-mail (hook management)
- step (agent step operations)
- burn, squash (agent-aware lifecycle)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:36:12 -08:00
Steve Yegge
ce3ae5b18e fix: Don't persist namepool theme in state file
Theme is configuration (from settings/config.json), not runtime state.
Loading theme from state file was causing rig config to be ignored,
which is why the beads rig kept using mad-max names instead of minerals.
2025-12-27 14:19:14 -08:00
Steve Yegge
b9ae4aa280 bd sync: 2025-12-27 00:42:24 2025-12-27 01:02:52 -08:00
Steve Yegge
a2306fc928 revert: Keep bd wisp/pour until v0.38.0 - API not released yet
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 01:02:52 -08:00
Steve Yegge
3981e46688 feat: Add safeguards to protect crew sessions from auto-cleanup
Crew workers are human-managed and should never be auto-killed by
gt doctor --fix. This adds defense-in-depth protection:

1. OrphanSessionCheck.Fix() now skips any session matching the
   gt-<rig>-crew-<name> pattern

2. OrphanProcessCheck.Fix() now checks if a process has a crew
   session pane as an ancestor before killing it

Even if detection fails (like the pgrep bug we just fixed), crew
sessions and their processes will be protected.

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 01:00:16 -08:00
Steve Yegge
1c7346b05e fix: Orphan process check now correctly detects tmux server on macOS
The orphan-processes check was incorrectly killing active crew sessions
because pgrep -x tmux does not reliably find the tmux server on macOS.

Root cause:
- pgrep -x tmux was finding tmux attach-session processes but missing
  the actual tmux server process
- Claude processes running in tmux panes were incorrectly flagged as
  orphaned because their parent (tmux server) was not in the allowed list

Fixes:
1. Use ps + awk instead of pgrep to find tmux processes more reliably
2. Exclude Claude.app desktop processes from orphan detection (they are
   not Gas Town CLI processes)

Closes: gt-ronyn

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 00:42:01 -08:00
Steve Yegge
3e8a0e1fb7 fix: Remove hardcoded gastown from role templates (gt-ne41f)
Use {{ .RigName }} and {{ .IssuePrefix }} template variables instead
of hardcoded 'gastown' and 'gt-' in prefix routing examples.
2025-12-27 00:39:11 -08:00
Steve Yegge
4a04febf05 Revert "feat(sling): auto-pour protos when --var provided"
This reverts commit af77b109d1.
2025-12-27 00:37:49 -08:00
Steve Yegge
af77b109d1 feat(sling): auto-pour protos when --var provided
When slinging a bead that has the template label (a proto), and --var
flags are provided, automatically call bd --no-daemon pour to
instantiate the proto with variable substitution before slinging.

This enables the seamless workflow:
  gt sling mol-release beads --var version=0.38.0

Instead of the manual two-step:
  bd --no-daemon pour mol-release --var version=0.38.0 --json
  gt sling <resulting-mol-id> beads

Also adds a warning when slinging a proto without --var, since
{{variables}} will not be substituted.

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 00:34:12 -08:00
Steve Yegge
554121deb6 feat: Add Propulsion Principle theory to all role templates
Adds comprehensive "Theory of Operation" section explaining WHY agents
must execute work immediately when found on their hook. Uses steam engine
metaphor to convey that this is physics, not politeness.

Each role gets a tailored metaphor:
- Mayor: main drive shaft
- Crew/Polecat: piston
- Deacon: flywheel
- Witness: pressure gauge
- Refinery: exhaust valve

The section explains the failure mode (agent waits, human is AFK,
Gas Town stops) and reinforces the propulsion principle.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 00:31:26 -08:00
Steve Yegge
a2bb4e46e5 bd sync: 2025-12-27 00:15:45 2025-12-27 00:15:45 -08:00
Steve Yegge
24ac5be2f7 bd sync: 2025-12-27 00:14:17 2025-12-27 00:14:17 -08:00
Steve Yegge
5dc150e2ad bd sync: 2025-12-27 00:08:20 2025-12-27 00:08:20 -08:00
Steve Yegge
43b53cbbbd feat: Add gt unsling command to clear work from hook
- gt unsling: clear your own hook
- gt unsling <bead>: only unsling if that bead is hooked
- gt unsling <target>: clear another agent's hook
- gt unsling <bead> <target>: unsling specific bead from agent
- gt unhook: alias for gt unsling

Symmetric with gt sling/hook commands.

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

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