Commit Graph

422 Commits

Author SHA1 Message Date
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
Steve Yegge
4e7a329ad8 bd sync: 2025-12-21 10:16:05 2025-12-21 10:16:05 -08:00
Steve Yegge
805c306e13 bd sync: 2025-12-21 10:15 2025-12-21 10:14:13 -08:00
Steve Yegge
cb8645e1cc bd sync: 2025-12-21 10:11:08 2025-12-21 10:11:08 -08:00
Steve Yegge
82d718ee34 feat(spawn): always create fresh polecat worktrees
Fixes gt-9nf: gt spawn should create fresh polecat worktree, never reuse

Changes:
- Add Recreate() method to polecat manager that removes and recreates worktrees
- Modify spawn.go to always recreate existing polecats with fresh worktrees
- Preserves safety checks: blocks if polecat is working or has uncommitted work
- Use --force to bypass uncommitted work checks

This ensures polecats always start with the latest code from the base branch,
avoiding stale code, stale beads, and git history pollution.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 10:10:27 -08:00
Steve Yegge
9a631b9195 fix(mail): normalize crew/polecats paths in addressToIdentity
Strip crew/ and polecats/ from addresses before identity conversion.
This ensures beads/crew/dave and beads/dave both resolve to beads-dave,
fixing the inbox mismatch bug (hq-0ol).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 10:06:13 -08:00
Steve Yegge
199da5aa9b fix(handoff): write crew state.json to correct location
The daemon verifies requesting_cycle=true in state.json before
executing lifecycle actions. For crew workers, the state file
must be at <townRoot>/<rig>/crew/<name>/state.json.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 01:24:56 -08:00
Steve Yegge
dbecfe1d38 feat(handoff): route crew lifecycle requests to deacon
Crew workers now use deacon for lifecycle management instead of
requiring manual session termination. When a crew worker runs
'gt handoff', it sends a lifecycle request to the deacon which
handles session kill/restart like it does for Mayor and Witness.

Changes:
- Route crew manager to deacon/ instead of "human"
- Add getCrewIdentity() to extract <rig>-crew-<name> from session
- Include full crew identity in LIFECYCLE subject for daemon parsing
- Remove special case that skipped lifecycle flow for crew

Also fixes pre-existing test failures in daemon/lifecycle_test.go
where BeadsMessage field names were out of sync with the struct.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 01:17:32 -08:00
Steve Yegge
bdbba025f5 fix(daemon): clear requesting_cycle after successful restart
Bug: When daemon cycled a session, it verified requesting_cycle=true
but never cleared the flag after restart. This caused infinite
cycle loops on each heartbeat.

Also removed redundant SendKeysDelayed("gt prime") that injected
rogue text into terminal (SessionStart hook already handles priming).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 01:14:20 -08:00
Steve Yegge
c4892938d0 fix(daemon): use gt mail instead of bd mail for lifecycle requests
The handoff command sends lifecycle requests via 'gt mail send' to
town-level beads, but the daemon was reading with 'bd mail inbox'
which reads from the local beads database. This fixes the mismatch.

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

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