Commit Graph

881 Commits

Author SHA1 Message Date
bullet
c33c4a929a feat(mail): Add sendToAnnounce() for bulletin board delivery (gt-q73h3)
Implements announce channel delivery in router.go:
- Add isAnnounceAddress() and parseAnnounceName() helpers
- Add ErrUnknownAnnounce error variable
- Add expandAnnounce() to load AnnounceConfig from messaging.json
- Add sendToAnnounce() for bulletin board delivery (single copy, no claiming)
- Add pruneAnnounce() for retention-based message cleanup
- Integrate announce routing in Send()

Announce channels store ONE copy of each message (unlike lists which fan-out).
Messages persist until retention limit is reached, with oldest messages
pruned automatically when limit is exceeded.

Also includes address helpers (gt-pn2fq dependency).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 00:24:22 -08:00
toecutter
346a283cc4 feat(mail): Add gt mail announces command to list and read bulletin boards (gt-27bzi)
Add announces subcommand to internal/cmd/mail.go that provides:
- gt mail announces: Lists all announce channels from messaging.json
- gt mail announces <channel>: Reads messages from a specific channel

The command queries beads for messages with announce_channel label and
displays them in reverse chronological order. Messages are NOT marked
as read or removed, preserving bulletin board semantics.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 00:22:17 -08:00
goose
3dda4f2b36 feat(convoy): Show status symbols and assignee for tracked issues
- Show ✓ for closed, ▶ for in_progress/hooked, ○ for other statuses
- Display assignee name in brackets instead of issue type
- Falls back to issue type when no assignee, or "unassigned" when neither

Closes gt-cbstf

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 00:21:23 -08:00
immortan
8c7ea8a991 feat(mail): Add isAnnounceAddress() and parseAnnounceName() helpers
Add announce address detection to internal/mail/router.go following
the same pattern as isListAddress/parseListName and isQueueAddress/
parseQueueName.

Added:
- isAnnounceAddress(address string) bool - returns true for 'announce:' prefix
- parseAnnounceName(address string) string - extracts channel name
- ErrUnknownAnnounce error variable

(gt-pn2fq)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 00:13:07 -08:00
mayor
302e14cf27 feat(prime): Add session metadata output for seance discovery
New outputSessionMetadata() function prints a structured line at prime start:
[GAS TOWN] role:mayor pid:12345 session:abc-uuid-123

This enables gt seance to discover sessions from Claude transcripts,
complementing the existing event emission to .events.jsonl.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 00:10:55 -08:00
organic
c328730a00 feat(mail): Add gt mail search command for inbox searching (gt-d46.4)
Adds `gt mail search <query>` command with:
- Regex pattern matching (case-insensitive by default)
- --from: Filter by sender address
- --subject: Only search subject lines
- --body: Only search message body
- --archive: Include archived (closed) messages
- --json: Output as JSON

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 23:38:01 -08:00
splendid
e7b9240238 fix(swarm): Remove non-existent --mol-type flag from bd update
gt swarm create was failing when using a pre-existing epic because
it tried to call `bd update --mol-type=swarm`, but bd update doesn't
support the --mol-type flag.

Fix: Only set mol-type during bd create (when epic doesn't exist.
Pre-existing epics work as-is since swarm functionality doesn't
depend on the mol-type field.

Closes gt-zqt4d

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
EOF
)
2026-01-01 23:24:26 -08:00
coma
092aa56b34 feat(mail): Add editor mode for gt mail reply command
When -m flag is not provided, opens $EDITOR to compose the reply.
The editor shows a template with the original message for context.
Comment lines (starting with #) are filtered out.

- Makes -m flag optional instead of required
- Falls back to vim/vi/nano/emacs if $EDITOR not set
- Updates help text to document editor mode (gt-d46.5)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 23:18:38 -08:00
ace
57f0559359 feat(mail): Add --quiet flag to gt mail check
Add --quiet (-q) flag for scripted mail checks:
- Outputs "N new message(s)" only when mail exists
- Silent output when no mail (exit 1)
- Fixes usage output being shown on exit 1

(gt-d46.1)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 23:18:06 -08:00
gastown/crew/jack
918fcc34fa feat: Add mail mark, purge, search commands and batch archive (gt-d46)
- gt mail mark <id> --read/--unread: Change message read status
- gt mail delete <id> --force: Add confirmation prompt (skip with --force)
- gt mail archive: Batch operations with --older-than, --all-read, --dry-run
- gt mail purge: Delete archived messages with --older-than, --dry-run, --force
- gt mail search <query>: Regex search with --from, --subject, --body, --json

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 20:31:29 -08:00
beads/crew/emma
36d64eee14 fix: show idle polecats as idle, not working
The display was normalizing idle → working which was misleading.
Idle polecats should show as idle so operators know to nuke them.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 20:07:39 -08:00
morsov
a16b94ffa8 fix(daemon): Reduce heartbeat from 10 min to 3 min for faster stuck detection (gt-6y5o3)
The 10-minute recovery heartbeat was too slow to detect stuck agents promptly.
Reduced to 3 minutes for better balance between detection speed and overhead.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 20:02:12 -08:00
keeper
cf97645e0d fix(refinery): Remove misleading git branch grep reference (gt-hwm9j)
The refinery template listed git branch -r | grep polecat as a reference
command, causing the refinery agent to check git branches instead of the
beads merge queue. This caused 41 MRs to pile up.

- Removed misleading git branch grep reference from Git Operations section
- Added explicit warnings about using gt mq list as sole source of truth
- Strengthened queue-scan step with CRITICAL warning

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:58:14 -08:00
rictus
937ee2c8b6 feat(convoy): Show active workers in convoy status output (gt-w5xj2)
Add worker information to convoy status display:

- Query agent beads across rigs for matching hook_bead
- Display worker inline with tracked issues: @gastown/nux (12m)
- Include Worker and WorkerAge in JSON output
- Skip worker lookup for closed issues

Example output:
  Tracked Issues:
    ○ gt-xyz: Fix bug [task]  @gastown/nux (12m)
    ✓ gt-abc: Add feature [task]

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:31:19 -08:00
rictus
dbdf47c37a fix(convoy): Make --notify flag work without argument (gt-qs8ur)
Use NoOptDefVal so --notify defaults to "mayor/" when specified without
a value:

- `--notify` (no arg) -> defaults to "mayor/"
- `--notify ops/` -> uses "ops/"
- (no flag) -> no notification

Removed the mayor-specific auto-default since NoOptDefVal handles this
for all roles.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:27:23 -08:00
rictus
478dc60db1 feat(connection): Add extended address parser (gt-f9x.10)
Implement address parsing for cross-machine operations:

Format: [machine:]rig[/polecat]

Examples:
- gastown/rictus -> local, gastown rig, rictus polecat
- vm:gastown/rictus -> vm machine, gastown rig, rictus
- gastown/ -> broadcast to gastown rig

Address struct with:
- ParseAddress() parser with validation
- String() canonical form
- IsLocal(), IsBroadcast() predicates
- Equal() comparison (normalizes local machine)
- Validate() against MachineRegistry
- RigPath() for rig/polecat without machine prefix

Includes comprehensive test coverage.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:24:51 -08:00
rictus
0013cc0f19 feat(connection): Add MachineRegistry for federation support (gt-f9x.9)
Implement MachineRegistry that manages machine configurations and
provides Connection instances for local and remote operations:

- Machine struct with name, type, host, key path, and town path
- Registry with JSON persistence (federation.json)
- CRUD operations: Get, Add, Remove, List
- Connection factory that returns appropriate Connection type
- Built-in "local" machine that cannot be removed

SSH connections return an error until SSHConnection is implemented.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:24:51 -08:00
rictus
b4ff6781b3 feat(connection): Add LocalConnection implementation (gt-f9x.8)
Implement LocalConnection that provides local file operations, command
execution, and tmux integration:

- File ops: ReadFile, WriteFile, MkdirAll, Remove, RemoveAll, Stat, Glob, Exists
- Command exec: Exec, ExecDir, ExecEnv
- Tmux: NewSession, KillSession, SendKeys, CapturePane, HasSession, ListSessions

Uses proper error wrapping with NotFoundError and PermissionError types.
Integrates with existing internal/tmux package for session management.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:20:32 -08:00
rictus
ca3c6da8ec feat(connection): Add Connection interface for local/remote ops (gt-f9x.7)
Define the Connection interface that abstracts file operations, command
execution, and tmux management for both local and remote (SSH) contexts.

Includes:
- Connection interface with file, exec, and tmux operations
- FileInfo interface for remote stat results
- BasicFileInfo implementation with JSON serialization
- Error types for connection failures

This enables Gas Town to manage rigs on remote machines using the
same interface as local operations.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:20:32 -08:00
rictus
00999feace fix: Replace deprecated strings.Title with cases.Title (gt-jdn2t)
Use golang.org/x/text/cases.Title(language.English) instead of the
deprecated strings.Title function. Updated formula.go (3 usages)
and patrol_helpers.go (1 usage).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:16:06 -08:00
cheedo
3389687dc0 feat(doctor): Add workspace-level health checks (gt-f9x.5)
Implements 6 workspace doctor checks:
- TownConfigExists: Verify mayor/town.json exists
- TownConfigValid: Validate town.json has required fields (type, version, name)
- RigsRegistryExists: Check mayor/rigs.json exists (fixable: creates empty)
- RigsRegistryValid: Verify registered rigs exist on disk (fixable: removes missing)
- MayorExists: Check mayor/ directory structure
- MayorStateValid: Validate mayor/state.json JSON (fixable: resets to default)

Added WorkspaceChecks() helper to return all workspace checks for registration.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:12:29 -08:00
valkyrie
1e2a068b2a feat(cmd): Add --collect to handoff and --handoff to resume (gt-1le)
- Add --collect/-c flag to gt handoff: auto-collects hooked work,
  inbox summary, ready beads, and in-progress items into the handoff
  message body
- Add --handoff flag to gt resume: checks inbox for messages with
  "HANDOFF" in subject and displays them formatted for continuation
- Supports both JSON and plain-text inbox output formats

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:11:04 -08:00
dag
b6eeac416d feat(doctor): Add rig-level health checks (gt-f9x.6)
Add 7 new checks for rig health when using `gt doctor --rig <name>`:

- rig-is-git-repo: Verify mayor/rig/ is a valid git clone
- git-exclude-configured: Check .git/info/exclude has Gas Town dirs (fixable)
- witness-exists: Verify witness/ structure exists (fixable)
- refinery-exists: Verify refinery/ structure exists (fixable)
- mayor-clone-exists: Verify mayor/rig/ clone exists (fixable)
- polecat-clones-valid: Verify polecat directories are valid clones
- beads-config-valid: Verify beads configuration works (fixable)

Checks are only registered when --rig flag is provided.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:10:12 -08:00
gastown/polecats/capable
844504686e feat(mail): Add gt mail clear command for bulk inbox clearing (gt-o0xbp)
Adds gt mail clear [target] command that:
- Clears all messages from an inbox
- Supports clearing your own inbox (no args) or another agent's
- Reports count of deleted messages
- Handles partial failures gracefully

Use case: Town quiescence - reset all inboxes across workers efficiently.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:06:55 -08:00
gastown/polecats/nux
a6ae2c6116 feat(backoff): Add gt agent state command and await-signal idle tracking
Layer 1: Implements gt agent state command for managing agent bead labels:
- gt agent state <bead> - Get all state labels
- gt agent state <bead> --set idle=0 - Set label value
- gt agent state <bead> --incr idle - Increment numeric label
- gt agent state <bead> --del idle - Delete label

Layer 2: Fixes await-signal iteration tracking:
- Adds --agent-bead flag to read/write idle:N label
- Implements exponential backoff: base * mult^idle_cycles
- Auto-increments idle counter on timeout
- Returns idle_cycles in result for caller to reset on signal

This enables patrol agents to back off during quiet periods while staying
responsive to signals. Part of epic gt-srm3y.

(gt-srm3y)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:58:56 -08:00
dag
5a4a691dfd feat(mq): Add 'mr' alias for merge request operations (gt-t85hw)
Adds 'gt mr' as an alias for 'gt mq' so both work:
- gt mr submit → gt mq submit
- gt mr status → gt mq status
- gt mr list → gt mq list

'MR' (merge request) is the conceptual noun; 'mq' (merge queue) is the
implementation detail. This reduces friction for agents and humans who
think in terms of "I have a merge request."

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:56:35 -08:00
dementus
b5ac9a2e55 feat(dnd): Add notification level control (gt-xmsme)
Implements Do Not Disturb mode for Gas Town agents:

- Add notification_level to agent bead schema (verbose, normal, muted)
- gt dnd [on|off|status] - quick toggle for DND mode
- gt notify [verbose|normal|muted] - fine-grained control
- gt nudge checks target DND status, skips if muted
- --force flag on nudge to override DND

This allows agents (especially Mayor) to mute notifications
during focused work like swarm coordination.

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:54:36 -08:00
rictus
f883a09317 feat(checkpoint): Add polecat session checkpoint for crash recovery (gt-441j6)
Add checkpoint system for polecats and crew workers to recover state
after session crash or context limit.

Features:
- internal/checkpoint package with Checkpoint type
- gt checkpoint write/read/clear commands
- Checkpoint display in gt prime startup
- Auto-detection of molecule, step, hooked bead
- Git state capture (modified files, branch, commit)

The checkpoint captures:
- Current molecule and step being worked
- Hooked bead
- Modified files list
- Git branch and last commit
- Session notes
- Timestamp

Checkpoints are stored in .polecat-checkpoint.json and displayed
during session startup via gt prime.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:53:39 -08:00
valkyrie
65c34efd4e feat(session): Add GUPP to non-polecat roles (Mayor, Deacon, Witness, Refinery)
GUPP (Gas Town Universal Propulsion Principle) is the propulsion nudge sent
after beacon to trigger autonomous work execution. Previously only polecats
received this nudge.

Now all roles get role-specific propulsion nudges on startup:
- Polecat/Crew: "Run `gt hook` to check your hook and begin work."
- Witness: "Run `gt prime` to check patrol status and begin work."
- Refinery: "Run `gt prime` to check MQ status and begin patrol."
- Deacon: "Run `gt prime` to check patrol status and begin heartbeat cycle."
- Mayor: "Run `gt prime` to check mail and begin coordination."

Changes:
- internal/session/names.go: Add PropulsionNudgeForRole() function
- internal/cmd/witness.go: Add GUPP nudge to ensureWitnessSession
- internal/cmd/start.go: Add GUPP nudge to ensureRefinerySession (also
  converted from respawn loop to direct Claude launch like other roles)
- internal/cmd/deacon.go: Add GUPP nudge to startDeaconSession
- internal/cmd/mayor.go: Add GUPP nudge to startMayorSession

Fixes: gt-zzpmt

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:52:42 -08:00
toast
3ecaf9d6fe feat(refinery): Add parallel worker support with MR claiming (gt-kgszr)
Implements Option A from the issue: multiple refinery workers with locking.

Changes to mrqueue:
- Add ClaimedBy/ClaimedAt fields to MR struct
- Add Claim(id, worker) method with atomic file operations
- Add Release(id) method to unclaim on failure
- Add ListUnclaimed() to find available work
- Add ListClaimedBy(worker) for worker-specific queries
- Claims expire after 10 minutes for crash recovery

New CLI commands:
- gt refinery claim <mr-id> - Claim MR for processing
- gt refinery release <mr-id> - Release claim back to queue
- gt refinery unclaimed - List available MRs

Formula updates:
- queue-scan now uses gt refinery unclaimed
- process-branch claims MR before processing
- handle-failures releases claim on test failure
- Claims prevent double-processing by parallel workers

Worker ID comes from GT_REFINERY_WORKER env var (default: refinery-1).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:51:44 -08:00
gastown/polecats/furiosa
e159489edb fix(sling): Set hook_bead atomically at polecat spawn time (gt-h46pk)
When slinging work to a rig (auto-spawning a polecat), the hook_bead
is now set atomically during agent bead creation rather than in a
separate updateAgentHookBead call after spawn.

This fixes cross-beads routing issues when town beads (hq-*) are slung
to rig polecats (gt-* agent beads). By setting hook_bead at creation
time within the polecat manager context, the correct beads routing is
used.

Changes:
- Add AddOptions struct with HookBead field to polecat.Manager
- Add AddWithOptions() and RecreateWithOptions() functions
- Pass HookBead through SlingSpawnOptions in cmd/polecat_spawn.go
- Pass beadID as HookBead in cmd/sling.go for rig target spawns

Note: updateAgentHookBead() is kept for non-spawn targets (existing
agents) and formula-on-bead mode (updates hook to wisp root after
creation).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:50:32 -08:00
gastown/polecats/capable
c2d87a9063 fix(witness): Remove mail response on HEALTH_CHECK nudges (gt-xbjxp)
Witnesses were sending HEALTH_OK mail to mayor on every deacon health
check (~30s), flooding the inbox. Updated witness templates to:

- Explicitly state NOT to mail on HEALTH_CHECK nudges
- Explain that Deacon tracks health via session status
- Add gotcha note in the main template

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:25:22 -08:00
gastown/polecats/slit
e6f3e0c28e feat(hook): Add gt hook show <agent> for viewing other agents' hooks
Adds a new subcommand `gt hook show <agent>` that displays what work
is on any agent's hook in a compact one-line format:

  gastown/polecats/nux: gt-abc123 'Fix the widget bug' [hooked]

Use cases:
- Mayor checking what polecats are working on
- Witness checking polecat status
- Debugging coordination issues
- Quick status overview

Also supports --json flag for machine-readable output.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:24:37 -08:00
dementus
03eeb38129 fix(git): Handle missing remote.origin.fetch in worktrees (gt-0eh3r)
When BranchPushedToRemote fails to use the tracking ref (e.g., due to
missing remote.origin.fetch config in worktrees), fall back to using
git ls-remote to get the remote SHA directly and compare.

This makes gt done more resilient in worktrees where the fetch refspec
may be incomplete or missing.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:23:07 -08:00
gastown/polecats/nux
7552be25e5 feat(mail): Add gt mail release command for releasing claimed queue messages
Implements the release subcommand to allow workers to release claimed
messages back to their queues. The command:
- Verifies the caller owns the claimed message
- Validates the message has a queue label
- Returns the message to open status with queue assignee

Includes TestMailReleaseValidation unit tests.

(gt-guyt5)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:22:28 -08:00
gastown/polecats/furiosa
261defa3b4 fix(witness): Add worktree cleanup to HandleMerged (gt-7uuye)
DefaultWitnessHandler.HandleMerged was only logging a message but not
actually cleaning up the polecat worktree. This left worktrees behind
after merges, even though sessions were killed.

Fixed by calling witness.AutoNukeIfClean which:
- Verifies cleanup_status before nuking (prevents work loss)
- Calls NukePolecat to kill session, remove worktree, and cleanup

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:21:42 -08:00
valkyrie
62354dfe1b feat(beads): Capture session_id in issue close for CV attribution
Pass CLAUDE_SESSION_ID environment variable to bd close for work attribution
tracking, enabling queries like "what work did this session do?" for entity
CV building (per decision 009-session-events-architecture.md).

Changes:
- beads.Close() and CloseWithReason() now pass --session to bd close
- Updated all direct exec.Command("bd", "close"...) calls:
  - internal/mail/mailbox.go - closeInDir()
  - internal/cmd/swarm.go - swarm land and cancel
  - internal/cmd/hook.go - auto-replace completed beads
  - internal/cmd/synthesis.go - convoy close
  - internal/cmd/crew_lifecycle.go - workspace removal
  - internal/cmd/polecat.go - polecat nuke

The bd CLI already supports --session (or CLAUDE_SESSION_ID env var) so
this change ensures consistent session tracking across all gt close paths.

Fixes: gt-nvz8b

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:20:50 -08:00
rictus
380f36b413 feat(deacon): Add zombie-scan backup check for idle polecats (gt-dpiw3)
Add gt deacon zombie-scan command that provides defense-in-depth
against Witness cleanup failures. The command:

- Scans all rigs for polecats that are idle, have no session running,
  no hooked work, and are stale (>10 min inactive)
- Reports found zombies with details
- Optionally nukes them and notifies the mayor

Flags:
  --dry-run        Preview only
  --threshold      Custom staleness threshold (default 10m)
  --nuke=false     Report only, do not clean up

Also adds zombie-scan step to mol-deacon-patrol formula.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 18:19:54 -08:00
dementus
db2b25d789 feat(nudge): Add channel:name syntax for fan-out nudges (gt-p2o6s)
Extends gt nudge to support channel-based targeting:
- gt nudge channel:<name> <message> nudges all channel members
- Channels defined in ~/gt/config/messaging.json under "nudge_channels"
- Supports patterns: gastown/polecats/*, */witness, gastown/crew/*

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 17:44:37 -08:00
gastown/polecats/capable
c1469018be feat(mail): Add gt mail claim command for queue message claiming (gt-t1kso)
Adds `gt mail claim <queue-name>` command that:
- Lists unclaimed messages in a work queue
- Picks the oldest unclaimed message
- Verifies caller eligibility against workers patterns
- Claims the message by updating assignee and status
- Prints claimed message details

Includes tests for worker pattern matching.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 17:43:40 -08:00
gastown/polecats/furiosa
278abf15d6 fix(hook): Read hook_bead from database column, not description (gt-7m33w)
The hook discovery code was reading hook_bead from the agent bead's
description field (parsed via ParseAgentFieldsFromDescription), but
the slot update code writes to the hook_bead database column via
'bd slot set'. This mismatch caused polecats to see stale hook values
from the description instead of the current value from the database.

Fixed in:
- molecule_status.go: Use agentBead.HookBead instead of parsing description
- status.go: Use issue.HookBead directly
- lifecycle.go: Update all GUPP and orphan detection to read from
  database columns instead of parsing description

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 17:42:31 -08:00
capable
61f8c80e35 fix(done): Verify branch has commits ahead of main before MR
Add CommitsAhead check after BranchPushedToRemote to prevent stale
branches (pushed but 0 commits ahead of main) from being submitted
to the merge queue.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

(gt-fpv2p)
2026-01-01 16:09:54 -08:00
slit
1e4cd86b56 feat(synthesis): Add synthesis step for convoy formulas (gt-v5s0j)
Implements the synthesis step that combines leg outputs into a final
deliverable for convoy workflows:

- `gt synthesis start <convoy-id>` - Start synthesis after verifying
  all legs are complete, collecting outputs, and slinging to polecat
- `gt synthesis status <convoy-id>` - Show synthesis readiness and
  leg completion status
- `gt synthesis close <convoy-id>` - Close convoy after synthesis

Key features:
- Collects leg outputs from formula-defined paths (e.g., findings.md)
- Creates synthesis bead with combined context from all leg outputs
- Integrates with formula.toml synthesis configuration
- Provides TriggerSynthesisIfReady() for automated synthesis trigger
- Adds SynthesisFields struct for tracking synthesis state in beads

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 16:01:28 -08:00
nux
98d68827f0 feat(formula): Implement gt formula run for convoy formulas
Add full convoy formula execution to gt formula run command:
- Parse formula file to extract legs, synthesis, and prompts
- Create convoy bead in town beads to track execution
- Create leg beads for each parallel leg with tracking relations
- Create synthesis bead with dependencies on all legs
- Sling each leg to a polecat with leg-specific context
- Support dry-run mode to preview execution

The implementation supports convoy-type formulas with parallel legs
and a synthesis step. Non-convoy formulas show manual execution steps.

(gt-574qn)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 15:57:18 -08:00
furiosa
cf03343fcf fix(mq): Add push verification before MR submission (gt-2hwi9)
CRITICAL: Prevents work loss from unpushed commits.

The bug: gt mq submit created MR beads without verifying the branch was pushed to remote. This allowed polecats to create MR beads for unpushed work, which the Refinery would skip and the Witness would nuke, losing work.

The fix: Add same push verification that gt done uses. Now both code paths require git push before MR submission.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 15:46:34 -08:00
nux
265dbcb1d0 feat(cmd): Add gt formula command with subcommands (gt-gpifj)
Add a proper `gt formula` command with subcommands:
- gt formula list - List available formulas
- gt formula show <name> - Display formula details
- gt formula run <name> - Execute a formula (scaffold for gt-574qn)
- gt formula create <name> - Create new formula templates

The create command generates valid TOML templates for:
- task: Single-step task formula
- workflow: Multi-step workflow with dependencies
- patrol: Repeating patrol cycle for wisps

Replaces the simple formulas.go that only delegated to `bd formula list`.
The `formulas` alias is preserved for backwards compatibility.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 15:39:25 -08:00
rictus
a395b4e19b feat(formula): Add formula.toml parser and validation
Implement internal/formula package for parsing and validating formula.toml files:
- types.go: Formula, Step, Leg, Aspect, Template, Input, Var structs
- parser.go: TOML parsing using BurntSushi/toml, validation, dependency resolution
- Supports convoy, workflow, expansion, and aspect formula types
- Infers type from content when not explicitly set
- Validates required fields, unique IDs, and dependency references
- Detects circular dependencies in workflow steps
- Provides TopologicalSort and ReadySteps for execution planning

(gt-5chbk)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 15:01:23 -08:00
gastown/crew/gus
f75eeb4da8 fix: Remove YAML usage, standardize on JSON/TOML
- Delete 5 legacy .formula.yaml files (have .toml replacements)
- Remove unused FileConfigYAML constant
- Add TODO for beads config.yaml → config.json migration (bd-10wg)
- Update docs to use JSON examples instead of yaml code blocks
- Change plugin frontmatter from YAML to TOML in docs
- Add .toml to code file detection in branch_check.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 11:18:09 -08:00
gastown/crew/joe
721b4ec1dd Centralize role emojis: Witness 👁→🦉, Deacon 🦉🐺
Added centralized emoji constants in internal/constants/constants.go
for easy customization. Updated all files that hardcoded role emojis
to use the new constants.

Changes:
- Witness emoji: 👁 (eye) → 🦉 (owl) - less creepy, matches visual identity
- Deacon emoji: 🦉 (owl) → 🐺 (wolf) - matches hierarchy prompt (wolf in engine room)
- Added RoleEmoji() helper function for string-based lookups
- Maintained backwards compatibility with legacy role names

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 11:10:52 -08:00
gastown/crew/jack
1e53cd78a6 fix: Security fixes and docs updates (gt-jsm2s, gt-d47q0, gt-orujk)
- convoy.go: Escape single quotes in SQL to prevent injection
- engineer.go: Add comment clarifying test command trust model
  (config.json is trusted infra, not PR-controlled)
- agents.go, prime.go, mayor.md.tmpl: Fix 'gt polecats' -> 'gt polecat list'

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 11:02:03 -08:00