Commit Graph

368 Commits

Author SHA1 Message Date
Steve Yegge
66ce691e9e bd sync: 2025-12-21 16:41:45 2025-12-21 16:41:45 -08:00
Steve Yegge
af6ab73514 bd sync: 2025-12-21 16:34:39 2025-12-21 16:34:39 -08:00
Steve Yegge
dcd86efe43 bd sync: 2025-12-21 16:30:54 2025-12-21 16:30:54 -08:00
Steve Yegge
bf71c44a28 bd sync: 2025-12-21 16:27:34 2025-12-21 16:27:34 -08:00
Steve Yegge
bc3d245c91 bd sync: 2025-12-21 16:17:44 2025-12-21 16:17:44 -08:00
Steve Yegge
6854d38f85 bd sync: 2025-12-21 16:04:18 2025-12-21 16:04:18 -08:00
Steve Yegge
87a4fee644 bd sync: 2025-12-21 16:03:09 2025-12-21 16:03:09 -08:00
Steve Yegge
1491359fde bd sync: 2025-12-21 16:00:40 2025-12-21 16:00:40 -08:00
Steve Yegge
09f34a656a bd sync: 2025-12-21 15:51:17 2025-12-21 15:51:17 -08:00
Steve Yegge
017e8ed53b bd sync: 2025-12-21 15:39:35 2025-12-21 15:39:35 -08:00
Steve Yegge
f2503f4714 bd sync: 2025-12-21 15:36:51 2025-12-21 15:36:51 -08:00
Steve Yegge
741082a811 bd sync: 2025-12-21 14:50:46 2025-12-21 14:50:46 -08:00
Steve Yegge
38d155b941 bd sync: 2025-12-21 14:34:54 2025-12-21 14:34:54 -08:00
Steve Yegge
53e66e688b bd sync: 2025-12-21 14:16:19 2025-12-21 14:16:19 -08:00
Steve Yegge
4bab11e828 bd sync: 2025-12-21 14:10:03 2025-12-21 14:10:03 -08:00
Steve Yegge
3ed8708a3b bd sync: 2025-12-21 14:09:03 2025-12-21 14:09:03 -08:00
Steve Yegge
6b1e6cab17 bd sync: 2025-12-21 14:01:11 2025-12-21 14:01:11 -08:00
Steve Yegge
f98598ac65 bd sync: merge from main 2025-12-21 11:45:59 -08:00
Steve Yegge
50c5639258 bd sync: 2025-12-21 11:11:12 2025-12-21 11:11:12 -08:00
Steve Yegge
148aa57d07 bd sync: 2025-12-21 10:29:40 2025-12-21 10:29:40 -08:00
Steve Yegge
eae81690d6 bd sync: 2025-12-20 22:50:19 2025-12-20 22:50:19 -08:00
Steve Yegge
9391e3a439 bd sync: 2025-12-20 22:04:36 2025-12-20 22:04:36 -08:00
Steve Yegge
5e22ed590d bd sync: 2025-12-20 21:26:32 2025-12-20 21:26:32 -08:00
Steve Yegge
21d2dd2e05 bd sync: 2025-12-20 21:20:14 2025-12-20 21:20:14 -08:00
Steve Yegge
448c9a27eb bd sync: 2025-12-20 21:04:34 2025-12-20 21:04:34 -08:00
Steve Yegge
868b9af112 bd sync: merge divergent histories (161 local + 293 remote commits) 2025-12-20 21:04:32 -08:00
Steve Yegge
74730854e8 bd sync: 2025-12-20 21:03:19 2025-12-20 21:03:19 -08:00
Steve Yegge
fc1f50502f feat(polecat): Add shared beads redirect for polecats (gt-cxtu)
When creating a polecat worktree, create a .beads/redirect file pointing
to the rig-level shared beads database. This eliminates git sync overhead
between polecats - they all connect to the same daemon and database.

Architecture:
  gastown/
    .beads/              <- Shared database (created if missing)
    polecats/
      nux/
        .beads/
          redirect       <- Contains "../../.beads"

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 20:54:37 -08:00
Steve Yegge
8fab4d3790 chore: VC pattern analysis + Deacon simplification
- Add gt-zhpa epic: VC Pattern Integration (6 child tasks)
  Extracted validated ideas from ~/src/vc that map to Gas Town primitives

- Close gt-5af: Deacon epic as over-engineered
  Problem solved by hooks + gt prime

- Create lightweight successors:
  - gt-htto: Heartbeat convention
  - gt-bnch: Human escalation

- Disable beads MCP plugin for Gas Town
  CLI works; MCP adds complexity without value

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 20:41:33 -08:00
Steve Yegge
bc4cec1494 docs(crew): Work off main, no feature branches
Crew workers are trusted maintainers who push directly to main:
- Own their clones (no isolation needed)
- Fast work cycles (10-15 min) make branch overhead wasteful
- Branches go stale with context cycling
- Polecats use branches/MRs; crew does not need review

Also updated two-level beads docs (removed stale rig-level references).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 18:35:02 -08:00
Steve Yegge
5f206348a5 fix: Use correct beads paths for molecule and statusline
- molecule.go: Use findLocalBeadsDir() for project-level beads
- statusline.go: Use findMailWorkDir() for mail count (town beads)

Part of two-level beads architecture cleanup.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 18:30:45 -08:00
Steve Yegge
c16324b713 fix(mail): Use town beads for all mail (two-level architecture)
Replace complex address-based routing with simple town root lookup.
All mail goes to ~/gt/.beads/ (town beads), eliminating the broken
rig-level routing.

Two-level model:
- Town beads (~/gt/.beads/): ALL mail and coordination
- Clone beads (<rig>/crew/*/.beads/): Project issues only

Fixes: gt-4qey

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 18:28:14 -08:00
Steve Yegge
f6ff533891 feat(mail): Sort pinned messages first in inbox (gt-ngu1)
Add Pinned field to BeadsMessage and sort pinned messages before
unpinned ones in listBeads(). Within each group, sort by newest first.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 17:53:52 -08:00
Steve Yegge
4c060f4aaa refactor(mail): Remove bd mail dependency, use bd create/list/show (gt-9xg)
Replace `bd mail send/inbox/read/ack` commands with `bd create/list/show/close`.
This separates the orchestration layer (gt) from the data plane (beads).

Changes:
- router.go: Use `bd create --type=message` instead of `bd mail send`
- mailbox.go: Use `bd list --type=message` and `bd show` for inbox/read
- types.go: Parse metadata from labels (from:, thread:, reply-to:)
- mail.go: Fix findBeadsWorkDir to prefer rig-level beads, fix crew address format

Messages are now stored as beads issues with type=message. Metadata (sender,
thread, reply-to) is stored in labels for retrieval.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 17:52:15 -08:00
Steve Yegge
d242239aa1 bd sync: add gt-976 crew lifecycle + gt-977 work request to max 2025-12-20 17:20:02 -08:00
Steve Yegge
38fd52779f bd sync: add gt-975 molecule execution support 2025-12-20 16:57:30 -08:00
Steve Yegge
4f21002132 feat(polecat): refuse to lose uncommitted work during cleanup (gt-8v8)
Add comprehensive uncommitted work checks before any polecat cleanup:
- Check for uncommitted changes (modified/untracked files)
- Check for stashes
- Check for unpushed commits

Affected commands:
- gt polecat remove: now refuses if uncommitted work exists
- gt rig shutdown: checks all polecats before shutdown
- Witness cleanup: refuses to clean polecats with uncommitted work
- gt spawn: warns if spawning to polecat with uncommitted work

Safety model:
- --force: bypasses uncommitted changes check only
- --nuclear: bypasses ALL safety checks (will lose work)

New git helpers:
- StashCount(): count stashes in repo
- UnpushedCommits(): count commits not pushed to upstream
- CheckUncommittedWork(): comprehensive work status check

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 16:54:16 -08:00
Steve Yegge
2a9f31a02d feat(polecat): Add bulk removal with --all and multi-polecat support (gt-hcc0)
- Add --all flag to remove all polecats from a rig: `gt polecat remove gastown --all`
- Support multiple rig/polecat args: `gt polecat remove gastown/A gastown/B`
- Report summary of removed polecats and any failures
- Validate that --all is not used with rig/polecat format

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 16:52:43 -08:00
Steve Yegge
df20acf782 feat(spawn): Add handoff protocol to spawn priming (gt-8os8)
- Updated buildWorkAssignmentMail with handoff protocol section
- Added gt done command for polecats to signal completion
- Handoff protocol includes checklist: git clean, issue closed, beads synced, code pushed
- gt done verifies pre-flight checks before sending completion notification to Witness

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 16:52:40 -08:00
Steve Yegge
6cfab58e86 feat(witness): Implement Witness MVP for automated polecat lifecycle
Implements the core Witness functionality:

- gt witness start: Creates tmux session with Claude, theming, auto-priming
- gt witness stop: Kills tmux session and updates state
- gt witness status: Shows session state reconciled with tmux
- Shutdown handler: Verifies git clean state before cleanup, sends nudges
- Auto-spawn: Spawns polecats for ready work up to configurable capacity
- Health checks: Monitors polecat activity, nudges stuck workers, escalates

Also updates handoff to include polecat name in lifecycle requests.

Closes: gt-53w6, gt-mxyj, gt-5wtw, gt-cpm2, gt-es1i

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 16:52:02 -08:00
Steve Yegge
c01e965d37 feat(prompts): Add witness role template with refined protocols
- Add clearer heartbeat protocol with step-by-step checklist
- Add structured mail checking procedure by message type
- Add nudge decision criteria with signal strength levels
- Add escalation thresholds (when to escalate vs handle locally)
- Add pre-kill verification checklist
- Add session self-cycling protocol
- Uses {{ rig }} template placeholders

Closes gt-qrze

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 16:50:26 -08:00
Steve Yegge
c1dde066ff feat(handoff): Auto-submit MR to merge queue when polecat shuts down
When a polecat runs `gt handoff` (default: shutdown action), the current
branch is now automatically submitted to the merge queue if it follows
the polecat/<name>/<issue> naming convention.

This streamlines the polecat workflow:
- Work on assigned issue
- Commit changes
- Run `gt handoff` (automatically submits MR + retires)

The Refinery will process the merge request. If MR submission fails,
a warning is printed but handoff continues.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 16:50:23 -08:00
Steve Yegge
2f5bbf5fdb feat(molecule): Add molecule catalog with hierarchical loading
Implement MoleculeCatalog for loading molecules from multiple sources:
1. Built-in molecules (shipped with the gt binary)
2. Town-level: <town>/.beads/molecules.jsonl
3. Rig-level: <rig>/.beads/molecules.jsonl
4. Project-level: .beads/molecules.jsonl

Changes:
- Add internal/beads/catalog.go with MoleculeCatalog type
- Update gt molecule list to show source (builtin, town, rig, project, database)
- Update gt molecule show to check catalog first, then database
- Update gt molecule instantiate to check catalog first
- Add gt molecule export command to export built-in molecules to JSONL
- Add --catalog and --db flags to gt molecule list

The catalog enables organizations to share molecule templates
independently of work item tracking, and allows customization
at different levels of the workspace hierarchy.

Closes gt-0ei3.

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 16:49:34 -08:00
Steve Yegge
5645f0bb78 feat(doctor): Add orphan session and process detection
Add two new health checks to gt doctor:

1. orphan-sessions: Detects Gas Town tmux sessions (gt-*) that do not
   match expected patterns (mayor, deacon, rig-witness, rig-refinery,
   rig-polecat). Validates rig names against actual workspace structure.

2. orphan-processes: Detects Claude/claude-code processes without a
   tmux parent. Walks process tree to find orphaned instances that
   may be consuming resources.

Both checks support --fix to clean up detected orphans:
- Kills orphaned tmux sessions
- Sends SIGINT (then SIGKILL) to orphaned processes

Closes gt-qsvq.

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 16:49:29 -08:00
Steve Yegge
3921b0e8d8 feat: Add gt done command for polecat work submission
Add `gt done` command as a convenience wrapper for polecats to signal
their work is ready for the merge queue. This addresses the missing
command referenced in polecat docs.

The command:
- Submits current branch to merge queue (same as gt mq submit)
- Auto-detects issue ID from branch name (polecat/<worker>/<issue>)
- Auto-detects integration branch if source issue has epic parent
- Provides polecat-friendly output messaging

Closes gt-qna4.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 16:49:29 -08:00
Steve Yegge
3e977a4017 fix: handoff wait timeout and refinery foreground race condition
- gt-dsfi: Add periodic warning messages to handoff wait instead of
  blocking forever with select{}. After 2 minutes, shows hints about
  checking daemon/witness status and how to abort.

- gt-n7z7: Skip tmux session existence check when in foreground mode.
  When background mode spawns foreground mode inside a tmux session,
  the foreground check would find its own session and return "already
  running". Now only checks PID when in foreground mode.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 16:49:29 -08:00
Steve Yegge
58cf789eee revert: let project beads config control sync-branch
The sync-branch setting is up to the project's .beads/config.yaml,
not something Gas Town should force. Projects can use bd doctor --fix
to configure sync-branch if they want multi-clone coordination.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 15:46:18 -08:00
Steve Yegge
317caace5e fix: auto-configure sync-branch for rig beads
New rigs now get sync-branch: beads-sync in their .beads/config.yaml
automatically. This enables multi-clone coordination for polecats,
crew members, and refinery.

Also added gt doctor check (beads-sync-branch) to verify existing rigs
have sync-branch configured, with --fix support.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 15:42:45 -08:00
Steve Yegge
ded1ffba0b docs: add two-level beads architecture documentation
Add clear explanations of the town-level vs rig-level beads architecture:
- Town beads (~/gt/.beads): HQ coordination, no sync-branch
- Rig beads (in git clones): project work, uses beads-sync branch
- Clarify that rig-level .beads at container is gitignored

Updated:
- docs/architecture.md: New 'Two-Level Beads Architecture' section
- CLAUDE.md: Enhanced existing section with table and sync-branch info
- templates/roles/*.tmpl: Added beads architecture to crew, polecat, mayor

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 15:37:52 -08:00
Steve Yegge
be0f77324f fix(refinery): avoid race condition in foreground mode
In foreground mode, skip the tmux session check since we are likely
running inside the session that background mode created. Only check
PID to avoid self-detection.

Fixes the issue where gt refinery start gastown --foreground would
detect its own tmux session as already running.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 15:16:56 -08:00