Commit Graph

1443 Commits

Author SHA1 Message Date
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
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