Commit Graph

1457 Commits

Author SHA1 Message Date
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
Steve Yegge
5d774b7d14 fix: Update remaining bd wisp calls to bd mol wisp
Missed patrol_helpers.go and sling.go in initial refactor.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 23:51:30 -08:00
Steve Yegge
bb5a78c4fa refactor: Update bd pour/wisp → bd mol pour/wisp
Beads CLI restructured: pour and wisp are now subcommands of mol.
- bd pour → bd mol pour
- bd wisp → bd mol wisp

Updated all documentation, templates, and code to use new command structure.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 23:49:45 -08:00
Steve Yegge
8298ee34b5 bd sync: 2025-12-26 23:38:13 2025-12-26 23:49:28 -08:00
Steve Yegge
b15c7173d4 chore: Drop JSON formula support, TOML only (gt-spt8v)
- Delete all .formula.json files (TOML versions exist)
- Update sling.go comment to say TOML only

Note: Doc updates were prepared but those docs were deleted
upstream in the recent refactoring.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 23:46:47 -08:00
Steve Yegge
e024886af5 docs: Remove outdated dynamic bonding section 2025-12-26 23:39:24 -08:00
Steve Yegge
dbd99f4c8d docs: Radically condense documentation (10k → 548 lines)
Replace 28 sprawling docs with 2 focused ones:
- README.md: User-focused, top-down intro (268 lines)
- docs/reference.md: Technical reference (280 lines)

Key changes:
- Top-down structure (formulas first, not beads)
- Bullets/tables over prose
- Human commands (start/shutdown/attach) vs agent commands
- All 6 roles documented (Overseer through Polecat)
- Ice-9/protomolecule easter eggs for the Expanse/Vonnegut fans
- Prefix-based beads routing explanation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 23:37:47 -08:00
Steve Yegge
fa0dfc324e feat: Add crew session cycling fix and daemon exponential backoff (gt-ws8ol)
- Fix crew next/prev: Pass session name via key binding to avoid run-shell context issue
- Add TouchTownActivity() for town-level activity signaling
- Implement daemon exponential backoff based on activity.json:
  - 0-5 min idle → 5 min heartbeat
  - 5-15 min idle → 10 min heartbeat
  - 15-45 min idle → 30 min heartbeat
  - 45+ min idle → 60 min heartbeat (max)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 21:15:08 -08:00
Steve Yegge
305345bf36 fix: Check tmux session before declaring lock stale
Previously, gt doctor --fix would kill workers whose spawning process had
exited, even though the Claude session was still running in tmux.

Now both identity_check.go and CleanStaleLocks check if the tmux session
exists before declaring a lock stale. A lock is only truly stale if BOTH
the PID is dead AND the session does not exist.

Also added ListSessionIDs() to tmux package to handle locks that store
session IDs (%N or $N format) instead of session names.
2025-12-26 20:49:06 -08:00
Steve Yegge
eb75f7c58f feat: Add clone-divergence check to bd doctor (gt-wqck)
Adds CloneDivergenceCheck that detects when git clones have drifted
significantly behind origin/main:
- >10 commits behind: WARNING
- >50 commits behind: ERROR (EMERGENCY)

Only checks clones on main branch, since off-main clones are already
caught by BranchCheck. This distinguishes from beads-sync divergence
which is expected behavior.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 20:20:50 -08:00
Steve Yegge
9cd6ce7460 bd sync: 2025-12-26 20:20:40 2025-12-26 20:20:40 -08:00
Steve Yegge
a82aaee60d bd sync: 2025-12-26 20:08:06 2025-12-26 20:08:06 -08:00
Steve Yegge
62f3f727ab docs: Add prefix-based routing to all role templates
Explains how bd commands route to the correct rig based on issue
prefix, and documents routes.jsonl location and debug mode.

Updated templates:
- mayor.md.tmpl (full section)
- crew.md.tmpl (full section)
- polecat.md.tmpl (full section)
- witness.md.tmpl (compact note)
- refinery.md.tmpl (compact note)
- deacon.md.tmpl (full section)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 20:05:26 -08:00
Steve Yegge
4405475c9b feat: Add prefix-based routing support for beads (gt-hrgpg)
- Add internal/beads/routes.go with helpers to manage routes.jsonl
- Update gt rig add to auto-append routes for new rigs
- Add prefix-conflict check to gt doctor

bd already has prefix routing via routes.jsonl - this wires up
Gas Town to maintain routes when rigs are added and detect conflicts.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 19:54:38 -08:00
Steve Yegge
43a848b719 bd sync: 2025-12-26 19:46:13 2025-12-26 19:54:38 -08:00
Steve Yegge
f8e295af35 bd sync: 2025-12-26 19:42:54 2025-12-26 19:54:38 -08:00
Steve Yegge
8122a9e944 fix: Remove hardcoded actors, let bd use default chain
bd defaults to $BD_ACTOR → git config user.name → $USER, which is
more accurate for system tools like doctor and rig init.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 19:50:30 -08:00
Steve Yegge
d3ed26f7a8 feat: Add crew auto-start config to gt start (gt-vz151)
gt start now reads rig settings (settings/config.json) and auto-starts
configured crew members. The crew.startup field supports:
- Single name: "dave"
- Multiple names: "max and joe" or "max, joe"
- All crew: "all"
- None: "none" or empty

Configured:
- beads: dave
- gastown: max and joe

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 19:46:02 -08:00
Steve Yegge
fe19c8d15e feat: Wire up created_by field for beads issues (gt-u6nri)
- Add CreatedBy field to Issue struct (matches beads GH#748)
- Add Actor field to CreateOptions, pass --actor to bd create
- Add ActorString() method to RoleInfo for identity formatting
- Update all beads.Create() callers to pass Actor
- Update direct bd create exec calls with --actor:
  - mail/router.go: uses sender identity
  - patrol_helpers.go: uses role name
  - doctor/patrol_check.go: uses "gt-doctor"
  - rig/manager.go: uses "gt-rig-init"

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 19:42:41 -08:00
Steve Yegge
f91dbd5301 bd sync: 2025-12-26 19:42:24 2025-12-26 19:42:24 -08:00
Steve Yegge
24b9a87e1c bd sync: 2025-12-26 19:42:03 2025-12-26 19:42:03 -08:00
Steve Yegge
33f48d8de1 bd sync: 2025-12-26 19:25:49 2025-12-26 19:26:09 -08:00
Steve Yegge
1a20012e35 Refactor prime.go: extract patrol helpers
- Create patrol_helpers.go with shared patrol logic
- Refactor 3 patrol context functions (~500 lines) to use shared helpers
- prime.go: 1561 → 1128 lines (28% reduction)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 19:23:45 -08:00
Steve Yegge
1429640723 bd sync: 2025-12-26 19:23:25 2025-12-26 19:23:26 -08:00
Steve Yegge
c13e2c72ce bd sync: 2025-12-26 19:22:27 2025-12-26 19:22:27 -08:00
Steve Yegge
a5ecc659d9 fix: Remove hardcoded gastown fallback from log.go (gt-h8k9d)
The crash logging fallback assumed users might have their town at
~/gastown, which only works if the gastown rig is installed. Now
only tries ~/gt as the conventional town root.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 19:21:10 -08:00
Steve Yegge
e48f7fcd6c fix: Role detection reads GT_RIG/GT_CREW env vars for crew identity
When GT_ROLE is set to a simple value like "crew", the role detection
was not reading GT_RIG and GT_CREW to get the full identity. This caused
gt mol status to show "/crew/" instead of "gastown/crew/max".

Now GetRoleWithContext checks these additional env vars when the rig
or polecat fields are empty after parsing the role string.

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 19:13:16 -08:00
Steve Yegge
036177ef53 bd sync: 2025-12-26 19:13:00 2025-12-26 19:13:00 -08:00
Steve Yegge
10723e689b feat: gt nudge prefixes messages with sender identity
Messages now show [from mayor] or [from beads/crew/dave] etc.
so recipients know who sent the nudge.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 19:02:43 -08:00
Steve Yegge
54f0932f81 fix: gt nudge now works with crew addresses (gt-mwiuk)
Detect crew/ prefix in polecatName and use crewSessionName() instead
of polecat session manager. This produces correct session names like
gt-beads-crew-dave instead of gt-beads-p-crew/dave.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 18:56:41 -08:00
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