Commit Graph

1417 Commits

Author SHA1 Message Date
Steve Yegge
4131638b5a fix: Prevent accidental re-sling of pinned beads
Add guard that checks if bead is already pinned before slinging.
Shows current assignee and requires --force to override.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 18:45:32 -08:00
Steve Yegge
c9e092f296 docs: Remove remaining gt spawn references (gt-1py3y)
Update README.md, mayor.md.tmpl, and formula docs to use gt sling.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 18:37:56 -08:00
Steve Yegge
b160cfc29c bd sync: 2025-12-26 18:35:55 2025-12-26 18:36:04 -08:00
Steve Yegge
0ad427e4a8 feat: Remove gt spawn completely - gt sling is THE command (gt-1py3y)
Fully remove gt spawn from the codebase:

- Delete spawn.go, create polecat_spawn.go with just sling helpers
- Remove all gt spawn references from docs and CLAUDE.md
- Update code comments to reference gt sling

gt sling now handles ALL work dispatch:
- Existing agents: gt sling <bead> mayor/crew/witness
- Auto-spawn: gt sling <bead> <rig>
- No-tmux: gt sling <bead> <rig> --naked
- With args: gt sling <bead> --args "..."

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 18:36:03 -08:00
Steve Yegge
ff22c84cd6 fix: Deacon propulsion - use town beads via redirect
The Deacon propulsion was broken because:
1. outputDeaconPatrolContext() created patrols in gastown/mayor/rig/.beads
2. checkSlungWork() looked in ~/gt/deacon/.beads/ (empty)
3. These were different locations - pinned work never found

Fix:
- Created redirect: ~/gt/deacon/.beads/redirect -> ../.beads (town beads)
- Changed outputDeaconPatrolContext() to use ctx.WorkDir instead of
  hardcoded gastown path
- Updated deacon template to remove hardcoded gastown references
- Updated wisp creation docs to use two-step pattern (create then pin)

Also cleaned up 14 stale patrol wisps that accumulated in rig beads
from repeated startup attempts.

Filed gt-0pdhj to track remaining hardcoded gastown dependencies.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 18:23:38 -08:00
Steve Yegge
0157857ee3 bd sync: 2025-12-26 18:22:45 2025-12-26 18:22:45 -08:00
Steve Yegge
6de8f80ea9 feat: Unify gt sling and gt spawn - sling is THE work dispatch command (gt-1py3y)
Complete unification of work assignment commands:

- Add spawn flags to sling: --naked, --create, --molecule, --force, --account
- SpawnPolecatForSling now accepts SlingSpawnOptions struct
- Deprecate gt spawn with warning pointing to gt sling
- Update no-tmux-mode.md to use sling examples

gt sling now handles:
- Existing agents (mayor, crew, witness, refinery)
- Auto-spawning polecats when target is a rig
- Formula instantiation and wisp creation
- No-tmux mode for manual agent operation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 18:19:14 -08:00
Steve Yegge
9462208f79 feat: Implement no-tmux mode with beads as data plane (gt-vc3l4)
Enable Gas Town to operate without tmux by using beads for args transport:

- Add `attached_args` field to beads AttachmentFields
- gt sling: Store args in bead description, graceful fallback if no tmux
- gt prime: Display attached args prominently on startup
- gt mol status: Include attached_args in status output
- gt spawn --naked: Assign work via mail only, skip tmux session

Agents discover args via gt prime / bd show when starting manually.
Docs added explaining what works vs degraded behavior in no-tmux mode.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 18:04:57 -08:00
Steve Yegge
5198e566b8 fix: Use --force for closing pinned beads, unpin naked beads (gt-lsfqq)
Fixes issues with the auto-replace logic:
- Use `bd close --force` for pinned beads (required by bd CLI)
- Naked beads (no molecule) get unpinned instead of closed
- Remove unused verifyBeadExistsForHook function

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 17:54:59 -08:00
Steve Yegge
2eb50d014b bd sync: 2025-12-26 17:53:42 2025-12-26 17:54:59 -08:00
Steve Yegge
a68e5bf95b fix: ignore lifecycle requests older than 6 hours (gt-a41um)
Defense in depth: Even if message deletion fails, stale lifecycle
requests (>6 hours old) are now ignored and deleted without execution.

This prevents ancient LIFECYCLE messages from killing sessions if
they somehow survive in the inbox.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 17:52:48 -08:00
Steve Yegge
6e68e12c2a feat: Auto-replace completed pins in gt hook (gt-lsfqq)
When hooking a new bead, if the existing pinned bead is complete
(no attached molecule, or all molecule steps closed), auto-replace it.

If the existing bead is incomplete, require --force flag to replace.

This reduces friction when switching between work items, especially
for patrol loops creating new wisps after completing old ones.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 17:47:26 -08:00
Steve Yegge
f3a79fe18e bd sync: 2025-12-26 17:44:26 2025-12-26 17:44:43 -08:00
Steve Yegge
96ce991bb7 fix: delete LIFECYCLE messages before executing action (gt-a41um)
P0 bug: Crew workers were being killed every 5 minutes due to stale
LIFECYCLE messages from days ago being reprocessed on each heartbeat.

Root cause: closeMessage() was only called after successful action
execution. Failed actions left messages in inbox to be reprocessed.

Fix: "Claim then execute" pattern - delete message FIRST, before
attempting the action. This guarantees stale messages are cleaned up
regardless of action outcome. If a lifecycle action is needed, the
sender must re-request.

Also improved closeMessage() to capture and log actual error output.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 17:44:21 -08:00
Steve Yegge
fe193c3048 gt version: Match bd version output format
Single-line output showing version, build type, branch and commit:
  gt version 0.1.0 (dev: main@62413d55cbb0)

Uses runtime/debug to get VCS info from build, with fallback to
git commands at runtime.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 17:06:43 -08:00
Steve Yegge
1659a92309 docs: Update sling help text to reflect pinned beads (not hook files)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 17:05:53 -08:00
Steve Yegge
7cac5b008d Merge branch 'main' of github.com:steveyegge/gastown 2025-12-26 16:58:03 -08:00
Steve Yegge
0056bdd592 Fix patrol wisp creation to use two-step pinning (propulsion fix)
The `bd wisp` command doesn't support `--assignee` flag. The patrol
creation for Deacon, Witness, and Refinery was silently failing because
of this invalid flag.

Changed from:
  bd wisp <proto-id> --assignee <agent>  # FAILS: unknown flag

To two-step pattern (matching how gt sling works):
  bd wisp create <proto-id>                              # Step 1: create
  bd update <wisp-id> --status=pinned --assignee=<agent> # Step 2: pin

Also fixed wisp ID extraction to look for "wisp-" prefix in addition
to "gt-" prefix.

Without this fix, the Propulsion Principle was broken for patrol agents:
- Patrol wisps were never created (silent failure)
- Agents had no pinned work on restart
- Autonomous work loops couldn't continue

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 16:57:10 -08:00
Steve Yegge
b00ce2992e bd sync: 2025-12-26 16:54:55 2025-12-26 16:54:55 -08:00
Steve Yegge
7145eb9805 bd sync: 2025-12-26 16:54:46 2025-12-26 16:54:46 -08:00
Steve Yegge
62413d55cb Fix GT_ROLE not set for crew workers (gt-sij0a)
crew_at.go and crew_lifecycle.go were not setting GT_ROLE when
starting crew sessions. This caused crew workers to inherit GT_ROLE
from the parent environment (often "mayor"), leading to incorrect
role detection.

Now properly exports GT_ROLE=crew along with GT_RIG, GT_CREW, and
BD_ACTOR when spawning Claude for crew workers.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 16:53:41 -08:00
Steve Yegge
495f31e8a0 molecule_status.go: Remove SlungWork field and output (gt-rgd9x.1) 2025-12-26 16:53:41 -08:00
Steve Yegge
a76b9af1a6 Fix deacon template test to match actual content
Test expected "Patrol Execution Protocol" but template uses
"Startup Protocol: Propulsion" heading instead.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 16:53:14 -08:00
Steve Yegge
7965a5cefc bd sync: 2025-12-26 16:53:05 2025-12-26 16:53:05 -08:00
Steve Yegge
7d387a209f bd sync: 2025-12-26 16:52:44 2025-12-26 16:52:44 -08:00
Steve Yegge
fa77770926 bd sync: 2025-12-26 16:51:57 2025-12-26 16:51:57 -08:00
Steve Yegge
1a1ab4842b Eradicate hook files, use pinned beads only (gt-rgd9x)
- Remove hook functions from internal/wisp/io.go (WriteSlungWork, ReadHook, BurnHook, etc.)
- Remove hook types from internal/wisp/types.go (SlungWork, Wisp, etc.)
- Update up.go to query pinned beads instead of reading hook files
- Remove SlungWork field from molecule_status.go
- Remove hook-*.json pattern from .beads/.gitignore
- Delete live hook file /Users/stevey/gt/deacon/.beads/hook-deacon.json

Work is now tracked exclusively via pinned beads (status=pinned, assignee=agent).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 16:46:39 -08:00
Steve Yegge
3c0208fc02 bd sync: 2025-12-26 16:23:29 2025-12-26 16:23:44 -08:00
Steve Yegge
45acdf68e3 molecule_step.go: Replace WriteSlungWork/BurnHook with pinned bead ops (gt-rgd9x.1) 2025-12-26 16:23:37 -08:00
Steve Yegge
03e0e541af spawn.go: Replace WriteSlungWork with bd update --status=pinned (gt-rgd9x.1) 2025-12-26 16:23:37 -08:00
Steve Yegge
42f4f0555f park.go: Replace ReadHook with pinned bead query (gt-rgd9x.1) 2025-12-26 16:23:37 -08:00
Steve Yegge
188fc88a83 resume.go: Replace WriteSlungWork with bd update --status=pinned (gt-rgd9x.1) 2025-12-26 16:23:37 -08:00
Steve Yegge
81f3a92a97 gt status: Show runtime state for all agents (gt-zbmg8)
- Add AgentRuntime struct to track tmux session status
- Implement discoverGlobalAgents() for Mayor/Deacon
- Implement discoverRigAgents() for witness/refinery/crew/polecats
- Update text output to show ✓ running / ✗ stopped for each agent
- Color-code status: green for running, red for stopped
- Include hook info inline with agent status
- JSON output includes full runtime state in 'agents' field

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 16:23:29 -08:00
Steve Yegge
94a41e9d2f bd sync: 2025-12-26 16:23:11 2025-12-26 16:23:11 -08:00
Steve Yegge
2117eb66f5 feat: Add tmux crash detection hooks (gt-i9s7o)
- Add SetPaneDiedHook to tmux package for crash detection
- Add gt log crash subcommand for hook callback
- Set pane-died hook when starting polecat sessions
- Distinguish exit types: 0=done, 130=kill (Ctrl+C), other=crash
- Rename townlog/townlog.go to townlog/logger.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 16:18:44 -08:00
Steve Yegge
490c8b6e24 bd sync: 2025-12-26 16:14:22 2025-12-26 16:14:30 -08:00
Steve Yegge
8131052207 Deprecate hook files, use pinned beads for propulsion (gt-rgd9x)
Replace hook file mechanism with discovery-based pinned beads:
- gt hook: now runs bd update <bead> --status=pinned
- gt sling: same, plus nudge to target
- gt handoff: same when bead ID provided
- gt prime: checks pinned beads instead of hook files
- gt mol status: no longer checks hook files

Key changes:
- outputAttachmentStatus: extended to all roles (was Crew/Polecat only)
- checkSlungWork: now queries pinned beads instead of reading hook files
- wisp/io.go functions: marked deprecated with migration notes

This follows Gas Town discovery over explicit state principle.
Hook files are kept for backward compatibility but no longer written.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 15:56:11 -08:00
Steve Yegge
2dcb3d9971 bd sync: 2025-12-26 15:54:12 2025-12-26 15:54:12 -08:00
Steve Yegge
ad35855e93 feat: Auto-spawn polecats when gt sling targets a rig (gt-1py3y)
When `gt sling <bead> <rig>` is used with a rig name as target, sling now
automatically spawns a fresh polecat and slings work to it. This provides
a simpler alternative to `gt spawn --issue <bead> <rig>` for quick dispatch.

Changes:
- Add IsRigName() helper to detect bare rig names
- Add SpawnPolecatForSling() for lightweight polecat creation
- Update sling to detect rig targets and auto-spawn
- Update help text for both sling and spawn to document behavior

Design: spawn and sling remain distinct commands with different purposes:
- sling: Light spawn with hook + nudge (quick dispatch)
- spawn: Full workflow with mol-polecat-work, mail, witness notification

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 15:52:40 -08:00
Steve Yegge
e2b8f16c48 Implement town activity logging (gt-ewzon)
Add centralized logging for Gas Town agent lifecycle events:
- spawn: new agent created
- wake: agent resumed
- nudge: message injected
- handoff: agent handed off
- done: agent finished work
- crash: agent exited unexpectedly
- kill: agent killed intentionally

Implementation:
- Add internal/townlog package with LogEvent() function
- Log to ~/gt/logs/town.log with human-readable format
- Add gt log command to view/tail/filter logs
- Integrate logging into spawn, nudge, handoff, done, stop, session commands

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 15:51:54 -08:00
Steve Yegge
d524f65af3 bd sync: 2025-12-26 15:51:39 2025-12-26 15:51:39 -08:00
Steve Yegge
af7810a81b bd sync: 2025-12-26 15:44:51 2025-12-26 15:44:51 -08:00
Steve Yegge
8cdbf1e6bd feat: Add --args flag for natural language executor instructions (gt-1py3y)
- Add Args field to SlungWork struct in wisp/types.go
- Add --args/-a flag to gt sling command
- Display args in gt prime autonomous mode
- Display args in gt mol status output

The --args string is stored in the hook and shown to the LLM executor,
which interprets the instructions naturally without schema maintenance.

Example: gt sling beads-release --args "patch release"

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 14:58:07 -08:00
Steve Yegge
fa16c64346 bd sync: 2025-12-26 14:16:57 2025-12-26 14:16:57 -08:00
Steve Yegge
0e90fca49f Simplify Witness patrol: linear + Task tool, no Christmas Ornament (gt-p3v5n)
Design pivot:
- Remove mol-polecat-arm and dynamic bonding pattern
- Replace with linear patrol (Deacon-style) + Task tool parallelism
- Cleanup wisps as finalizers (marker wisp = pending cleanup)
- Discovery over tracking (no persistent nudge counts)

New docs:
- polecat-lifecycle.md: step-based restart model, evolution path
- witness-patrol-design.md: simplified, terse

Closed obsolete issues: gt-p3v5n.1 through gt-p3v5n.4

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 14:16:41 -08:00
Steve Yegge
1df41e23c7 bd sync: 2025-12-26 13:20:56 2025-12-26 13:36:32 -08:00
Steve Yegge
36eb38be82 Crew sessions: use respawn-pane for cleaner lifecycle (gt-09i4)
Replace SendKeys approach with respawn-pane -k when starting Claude
in crew sessions. This gives cleaner exit behavior:
- Before: Claude exits → shell prompt → exit shell → session ends
- After: Claude exits → session ends (no intermediate shell)

Changes:
- Add GetPaneID() to tmux package for pane ID retrieval
- Update crew_at.go to use RespawnPane for both new and restart cases
- Remove unnecessary waits and multi-step Claude startup

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 13:20:50 -08:00
Steve Yegge
e8a50e5cbf bd sync: 2025-12-26 13:20:31 2025-12-26 13:20:31 -08:00
Steve Yegge
8fff42fde7 test: Add integration tests for gt mol step done
Tests cover:
- extractMoleculeIDFromStep: parsing step IDs (gt-xxx.N format)
- findNextReadyStep: dependency-aware step selection
- Step done scenarios: continue, done, blocked

Also fixes:
- Handle trailing dot in step IDs (gt-abc. -> error)
- Skip in_progress steps when finding next ready step

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 13:20:14 -08:00
Steve Yegge
b7f9ce7215 bd sync: 2025-12-26 13:20:03 2025-12-26 13:20:03 -08:00