Commit Graph

1489 Commits

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