Commit Graph

431 Commits

Author SHA1 Message Date
Steve Yegge
107b6bf16b feat(daemon): add attachment detection for Deacon patrol system
Implements gt-rana.2: Daemon attachment detection

- Add Labels field to beads.Issue struct to parse label arrays
- Add attachment APIs: AttachMolecule, DetachMolecule, GetAttachment
- Add helper methods: HasAttachment, IsNaked for checking attachment state
- Add checkDeaconAttachment to daemon heartbeat cycle
- When Deacon's pinned bead is naked (no attached molecule):
  - Find or create mol-deacon-patrol template
  - Instantiate patrol molecule with steps as child issues
  - Attach molecule to Deacon's pinned bead
  - Nudge Deacon to start patrol loop
- Add comprehensive tests for attachment functionality

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 16:15:46 -08:00
Steve Yegge
0dab88e8bf feat(icons): centralize agent icons and add to all displays
- Mayor: 🎩 (top hat)
- Deacon: 🦉 (owl)
- Witness: 👁 (eye)
- Refinery: 🏭 (factory)
- Crew: 🧑‍💻 (technologist)
- Polecat: 😺 (happy cat)

Icons now show in:
- tmux status lines for all agent types
- gt status rig indicators
- gt witness status output
- gt agents popup menu
2025-12-21 16:10:20 -08:00
Steve Yegge
ca93a45b7d feat(doctor): add ephemeral beads health checks
Add gt doctor checks for ephemeral beads repos:
- ephemeral-exists: Verify .beads-ephemeral/ exists for each rig (fixable)
- ephemeral-git: Verify it's a valid git repo (fixable)
- ephemeral-orphans: Detect molecules >24h old (needs manual review)
- ephemeral-size: Warn if repo >100MB
- ephemeral-stale: Detect molecules with no activity in last hour

Implements gt-3x0z.3.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 16:04:31 -08:00
Steve Yegge
a0de2b1f47 bd sync: 2025-12-21 15:51:49 2025-12-21 16:04:31 -08:00
Steve Yegge
8fbd2205fd bd sync: 2025-12-21 15:48:07 2025-12-21 16:04:31 -08:00
Steve Yegge
7ee798c533 style: update agent icons (top hat, tower, cat face) 2025-12-21 16:00:37 -08:00
Steve Yegge
2e59c002e8 feat(beads): add attachment fields for pinned beads (gt-rana.1)
Implement AttachmentFields to track molecule attachments on pinned/handoff beads:
- AttachedMolecule: root issue ID of attached molecule
- AttachedAt: timestamp when attached

API:
- AttachMolecule(pinnedBeadID, moleculeID) - attach
- DetachMolecule(pinnedBeadID) - detach
- GetAttachment(pinnedBeadID) - query
- ParseAttachmentFields(issue) - parse from description
- FormatAttachmentFields(fields) - format for description

Includes comprehensive tests for parsing and API.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 15:53:15 -08:00
Steve Yegge
9c2adb9734 fix(tmux): correct witness session name pattern (gt-witness-<rig>) 2025-12-21 15:50:22 -08:00
Steve Yegge
51d536514a refactor: rename ephemeral to wisp (beads v0.33.1 terminology)
Update .beads-ephemeral/ to .beads-wisp/ per beads v0.33.1:
- Renamed initEphemeralBeads to initWispBeads
- Changed directory from .beads-ephemeral/ to .beads-wisp/
- Changed config from ephemeral: true to wisp: true
- Updated help text and output messages
- Updated tests

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 15:49:09 -08:00
Steve Yegge
b67141f3fc feat: add .beads-ephemeral/ creation to gt rig add
During rig initialization, now creates a .beads-ephemeral/ directory:
- Initialized as a git repo (for local versioning)
- Contains config.yaml with ephemeral: true
- Automatically added to rig .gitignore

This provides a local-only beads database for runtime tracking of
wisps and molecules, separate from the synced .beads/ database.

Closes gt-3x0z.1

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 15:49:09 -08:00
Steve Yegge
ef2b2e00a0 feat(tmux): add witness and refinery status line displays
- Witness shows polecat count under management (👁 N polecats)
- Refinery shows MQ length and processing status (🏭 MQ: N or 🏭 idle)
- Both show mail count when messages pending

Closes: gt-bd2l, gt-zayu
2025-12-21 15:48:14 -08:00
Steve Yegge
fb0d8c1bb9 feat(mol): add deacon-patrol molecule definition
Define the Deacon patrol molecule in builtin_molecules.go with 7 steps:
1. inbox-check - Handle callbacks from agents
2. health-scan - Ping Witnesses and Refineries
3. plugin-run - Execute registered plugins
4. orphan-check - Find abandoned work (uses wisp terminology)
5. session-gc - Clean dead sessions and wisp artifacts
6. context-check - Check own context limit
7. loop-or-exit - Burn and let daemon respawn, or exit if context high

Added DeaconPatrolMolecule() to BuiltinMolecules() list and added
corresponding test in builtin_molecules_test.go.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 15:47:10 -08:00
Steve Yegge
0fc74de3a3 bd sync: 2025-12-21 15:40:36 2025-12-21 15:40:36 -08:00
Steve Yegge
fe0c21b477 bd sync: 2025-12-21 15:37:59 2025-12-21 15:37:59 -08:00
Steve Yegge
f22b19588c bd sync: 2025-12-21 15:29:13 2025-12-21 15:29:57 -08:00
Steve Yegge
a49032ca5b bd sync: 2025-12-21 15:28:54 2025-12-21 15:29:57 -08:00
Steve Yegge
da94d8ee94 bd sync: 2025-12-21 15:28:35 2025-12-21 15:29:57 -08:00
Steve Yegge
99d4293c8c bd sync: 2025-12-21 15:28:17 2025-12-21 15:29:57 -08:00
Steve Yegge
cd8b29eb24 bd sync: 2025-12-21 15:28:01 2025-12-21 15:29:57 -08:00
Steve Yegge
386168fabf feat(doctor): add town-git check for version control
Checks whether the town root (~/gt) is under git version control.
Having the town harness in git is optional but recommended for:
- Backing up personal Gas Town configuration and history
- Tracking mail and coordination beads
- Easier federation across machines

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 15:01:10 -08:00
Steve Yegge
b06e9d87ca docs: add wisp molecule terminology and steam engine metaphor
- Add steam engine metaphor (proto=fuel, wisp=steam, digest=distillate)
- Add Wisp Molecules section explaining transient execution traces
- Update molecule core concepts table with proto/wisp/digest/burn/squash
- Update OS metaphor table with running processes = wisp molecules
- Update polecat description with molecule-first workflow
- Update shutdown protocol to include wisp squashing

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 14:51:16 -08:00
Steve Yegge
a3da3302a3 fix(mail): use slash-based identity format for addresses
Changes mail identity format from hyphenated (gastown-Toast) to
slash-based (gastown/polecats/Toast) to:
- Match directory structure (REST-like)
- Distinguish from hyphenated bead IDs (gt-xyz) and molecule names

Updated:
- addressToIdentity(): preserve slashes instead of replacing with dashes
- identityToAddress(): simplified, identity == address now
- detectSender(): include /polecats/ in polecat addresses
- Tests updated for new format

Closes gt-cxtu: shared beads architecture verified working.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 14:28:14 -08:00
Steve Yegge
00612f6949 bd sync: 2025-12-21 14:28:05 2025-12-21 14:28:05 -08:00
Steve Yegge
f4379944a3 Merge polecat/furiosa: fix lifecycle parser order (gt-rixa)
Check restart/shutdown before cycle to avoid matching 'lifecycle:' prefix.
Use ' cycle' (with leading space) for word boundary matching.

Resolved conflict: fixed variable name (title → subject).
2025-12-21 14:14:53 -08:00
Steve Yegge
36d6fc28f3 fix: check restart/shutdown before cycle in lifecycle parser
The parseLifecycleRequest function was checking for "cycle" first,
but since the title already contains "lifecycle:" (which includes
"cycle"), all lifecycle messages matched as cycle actions, making
restart and shutdown unreachable.

Fixed by:
1. Checking restart/shutdown before cycle
2. Using " cycle" (with leading space) to match the word, not prefix

Closes gt-rixa

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 14:08:49 -08:00
Steve Yegge
51a23ff2c8 chore: ignore issues.jsonl on main (tracked on beads-sync only)
This eliminates 'modified issues.jsonl' noise in git status on main.
bd sync commits to beads-sync branch, which has its own .gitignore
that continues to track issues.jsonl for multi-clone coordination.
2025-12-21 14:01:46 -08:00
Steve Yegge
17eeaebfc7 bd sync: 2025-12-21 13:52:58 2025-12-21 13:52:58 -08:00
Steve Yegge
854c37cddb bd sync: 2025-12-21 13:39:42 2025-12-21 13:39:42 -08:00
Steve Yegge
19d522bbb8 bd sync: 2025-12-21 12:18:36 2025-12-21 12:18:44 -08:00
Steve Yegge
308a7bc190 gt-975: Molecule execution support for polecats and crew
Added molecule workflow integration to Gas Town:

1. spawn.go: MoleculeContext in work assignment mail
   - Shows step N/M and molecule ID in subject
   - Includes molecule workflow instructions
   - Guides polecat through DAG execution

2. prime.go: outputMoleculeContext()
   - Detects if in-progress issue is a molecule step
   - Shows molecule progress and next steps
   - Displays molecule work loop instructions

3. molecule.go: 'gt molecule progress' command
   - Shows execution progress for molecule root
   - Displays done/in-progress/ready/blocked steps
   - Progress bar and completion percentage
   - JSON output for Witness automation

This enables polecats to work through molecule DAGs:
- Receive molecule-aware work assignments
- See context in gt prime output
- Follow DAG with 'bd ready --parent <root>'
- Witness can monitor with 'gt molecule progress'

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 12:03:21 -08:00
Steve Yegge
beb4efc4f9 bd sync: 2025-12-21 12:03:05 2025-12-21 12:03:05 -08:00
Steve Yegge
24123ad678 bd sync: 2025-12-21 12:00:18 2025-12-21 12:00:18 -08:00
Steve Yegge
ac6c99efb5 docs: remove obsolete bd ready/list from worker instructions
- Update Finding Work section with mail cwd clarification
- Replace bd ready/list with molecule-based work assignment
- Workers now receive work from overseer, not by polling bd

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 11:54:06 -08:00
Steve Yegge
12a8b7e2b3 feat(crew): auto-prime when exec'ing Claude in-session
When running `gt crew at <name>` from inside the target session, we exec
Claude directly. Previously this meant we couldn't send `gt prime` afterward.

Now we pass "gt prime" as the initial prompt argument to the Claude CLI,
so Claude loads context immediately upon startup.

Closes gt-qivm

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 11:51:58 -08:00
Steve Yegge
3c5622fda0 bd sync: 2025-12-21 11:51:11 2025-12-21 11:51:11 -08:00
Steve Yegge
a9830ba626 bd sync: 2025-12-21 11:44:40 2025-12-21 11:46:58 -08:00
Steve Yegge
a2f3c783e1 bd sync: 2025-12-21 11:43:24 2025-12-21 11:46:58 -08:00
Steve Yegge
d7e48a5057 bd sync: 2025-12-21 11:28:28 2025-12-21 11:46:58 -08:00
Steve Yegge
ff654eee59 feat(mq): auto-cleanup polecats after MR submission
When `gt mq submit` is run from a polecat work branch (polecat/<worker>/<issue>),
it now automatically triggers polecat shutdown after submitting the MR. The
polecat sends a lifecycle request to its Witness and waits for termination.

This eliminates the need for polecats to manually run `gt handoff --shutdown`
after completing work - they can just run `gt mq submit` and the cleanup
happens automatically.

Added `--no-cleanup` flag to disable auto-cleanup when needed (e.g., for
submitting multiple MRs or continuing work).

Closes gt-tca

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 11:44:35 -08:00
Steve Yegge
d5f4188ed6 feat: add --mail flag to gt rig reset to clear stale messages
Closes gt-48bs: gt rig reset now clears stale mail messages.
- Non-pinned messages are closed with reason 'Cleared during reset'
- Pinned messages have their content cleared but remain open
- Works with both --mail flag and default reset (all state)
2025-12-21 11:28:22 -08:00
Steve Yegge
a80ae0a212 bd sync: 2025-12-21 11:21:31 2025-12-21 11:21:31 -08:00
Steve Yegge
07a40771da feat: add gt orphans command to find lost polecat work
Implements gt-b2hj: Uses git fsck --unreachable to find orphaned commits
that were never merged to main.

Features:
- Filters to commits only (not blobs/trees)
- Date filtering (--days=N, default 7)
- Excludes stash commits (WIP on, index on, etc.)
- Excludes routine bd sync commits
- Shows recovery hints (cherry-pick, show, branch)
2025-12-21 11:11:03 -08:00
Steve Yegge
d9d4431377 bd sync: 2025-12-21 11:07:45 2025-12-21 11:07:45 -08:00
Steve Yegge
facef385f7 feat(mail): add gt mail archive command (alias for delete) 2025-12-21 10:44:54 -08:00
Steve Yegge
5ee9bb13c8 fix: replace stale 'bd mail' references with 'gt mail'
- docs/architecture.md: update mail routing explanation
- internal/witness/manager.go: fix actual bd mail calls to gt mail
- internal/cmd/mail.go: remove stale compatibility note
- internal/daemon/lifecycle.go: update comment
2025-12-21 10:44:20 -08:00
Steve Yegge
f3afa149a5 fix: notification banner should say 'gt mail' not 'bd mail' 2025-12-21 10:41:27 -08:00
Steve Yegge
7ff7cbc426 bd sync: 2025-12-21 10:33:17 2025-12-21 10:41:27 -08:00
Steve Yegge
3b32aa3da0 fix(shutdown): fully cleanup polecats on shutdown
gt shutdown now performs full polecat cleanup after killing sessions:
- Removes worktrees
- Deletes polecat branches from mayor's clone
- Protects polecats with uncommitted work (refuses to clean)

Added --nuclear flag to force cleanup even with uncommitted work.

Closes gt-u1k

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 10:33:11 -08:00
Steve Yegge
ae6f4c8185 fix(spawn): resolve variable shadowing and branch deletion edge case
- Move router and polecatAddress definitions before if block to avoid
  shadowing (defining same vars inside and after the block)
- Handle branch deletion failure in Recreate() by checking if branch
  still exists and using WorktreeAddExisting like Add() does

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 10:29:32 -08:00
Steve Yegge
e07eb96144 feat(cli): add --version flag to gt
Models often guess --version exists. Cobra provides both --version and -v
when Version is set on the root command.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 10:18:37 -08:00