Commit Graph

30 Commits

Author SHA1 Message Date
JJ
b1a5241430 fix(beads): align agent bead prefixes and force multi-hyphen IDs (#482)
* fix(beads): align agent bead prefixes and force multi-hyphen IDs

* fix(checkpoint): treat threshold as stale at boundary
2026-01-16 12:33:51 -08:00
rictus
392ff1d31b feat(convoy): add --owner flag for targeted completion notifications
Add --owner flag to gt convoy create to track who requested a convoy.
Owner receives completion notification when convoy closes (in addition
to any --notify subscribers). Notifications are de-duplicated if owner
and notify are the same address.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 00:03:02 -08:00
gastown/crew/dennis
e442212c05 feat(convoy): add close command for manual convoy closure
Add `gt convoy close` command to manually close convoys regardless of
tracked issue status. This addresses the desire path identified in
convoy-lifecycle.md.

Features:
- Close convoy with optional --reason flag
- Send notification with optional --notify flag
- Idempotent: closing already-closed convoy is a no-op
- Validates convoy type before closing

Closes hq-2i8yw

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 18:12:47 -08:00
gastown/crew/joe
d126c967a0 fix: handle bd --no-daemon exit code 0 bug on not-found (#339)
When bd --no-daemon show <id> does not find an issue, it incorrectly exits
with code 0 (success) but writes the error to stderr and leaves stdout empty.
This causes JSON parse failures throughout gt when code tries to unmarshal
the empty stdout.

This PR handles the bug defensively in all affected code paths:
- beads.go run(): Detect empty stdout + non-empty stderr as error
- beads.go wrapError(): Add 'no issue found' to ErrNotFound patterns
- sling.go: Check len(out) == 0 in multiple functions
- convoy.go getIssueDetails(): Check stdout.Len() == 0
- prime_molecule.go: Check stdout.Len() == 0

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 18:37:01 -08:00
shiny
a5ff31428b fix(sling): use correct beads database for rig-level beads (gt-n5gga)
When slinging rig-level beads (gt-*, bd-*, etc.), the BEADS_DIR was
unconditionally set to town beads, which could bypass the redirect-based
routing needed for these beads. This caused assignee updates to potentially
fail silently or target the wrong database.

Changes:
- sling.go: Only set BEADS_DIR for town-level (hq-*) beads; rig-level
  beads now use redirect from polecat worktree for proper routing
- convoy.go: Add --no-daemon to bd show calls to ensure fresh data

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 00:21:42 -08:00
vuvalini
00d73b8f8c perf: Batch and parallelize convoy worker lookups (gt-a40d8)
Optimize getWorkersForIssues() from O(N×R) to O(R) subprocess calls:
- Batch sqlite queries per rig using WHERE hook_bead IN (...)
- Parallelize rig lookups with goroutines

Expected improvement: 300-600ms → 50-100ms for moderate convoys

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 14:49:38 -08:00
max
1b69576573 fix: Address golangci-lint errors (errcheck, gosec) (#76)
Apply PR #76 from dannomayernotabot:

- Add golangci exclusions for internal package false positives
- Tighten file permissions (0644 -> 0600) for sensitive files
- Add ReadHeaderTimeout to HTTP server (slowloris prevention)
- Explicit error ignoring with _ = for intentional cases
- Add //nolint comments with justifications
- Spelling: cancelled -> canceled (US locale)

Co-Authored-By: dannomayernotabot <noreply@github.com>

🤖 Generated with Claude Code
2026-01-03 16:11:55 -08:00
capable
a62b35a85c feat(convoy): Add stranded convoy detection and feeding (gt-8otmd)
Add `gt convoy stranded` command to detect convoys with ready work but
no workers processing them. A convoy is stranded when it has open,
unblocked issues with no live assignee.

- New command outputs stranded convoy IDs with ready issue counts
- Supports --json for automation by Deacon patrol
- Checks blocked status via bd blocked
- Verifies assignee session liveness via tmux

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:27:53 -08:00
dementus
0bcd8acecb feat(convoy): Add --tree flag to show convoy + child status tree
Shows convoys with their tracked issues in a tree format:
🚚 hq-cv-abc: Convoy Name (3/5)
├── ✓ gt-123: Closed issue
├── ▶ gt-456: In progress issue
└── ○ gt-789: Pending issue

Makes convoy progress visible at a glance without running 'gt convoy status' on each one.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:19:26 -08:00
slit
31d6f6acf1 feat(convoy): Add gt convoy check for cross-rig auto-close (gt-00qjk)
Convoys in town beads track issues in rig beads via external:rig:id
references. When bd close runs in a rig, the convoy auto-close logic
only checks the local database, missing convoys in town beads.

This adds `gt convoy check` to bridge that gap:
- Finds all open convoys in town beads
- Checks if all tracked issues (across rigs) are closed
- Auto-closes completed convoys
- Sends notification if convoy has notify address

Can be called manually or by deacon patrol.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 14:02:45 -08:00
rictus
2199bdffea fix(convoy): Auto-detect issue IDs in convoy create first arg
When first arg to `gt convoy create` looks like a beads issue ID
(e.g., gt-abc, bd-xyz), treat all args as issues and auto-generate
the convoy name from the first issue title.

This prevents the bug where `gt convoy create gt-abc` would use
"gt-abc" as the convoy name instead of recognizing it as an issue
to track.

(gt-7qyfh)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 14:00:51 -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
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
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
gastown/crew/jack
7d6ea09efe feat(convoy): Add numbered shortcuts and interactive TUI (gt-fo0qa)
- Add numbered prefixes to `gt convoy list` output (1. 2. 3. ...)
- Support numeric shortcuts in `gt convoy status <n>`
- Add `-i/--interactive` flag for expandable tree view TUI
- New internal/tui/convoy package with bubbletea-based UI
  - j/k navigation, enter to expand/collapse
  - 1-9 to jump directly to convoy

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 12:58:56 -08:00
gastown/crew/max
0dc2c4ab7b Fix N+1 query in convoy status fetching (gt-wah8i)
getTrackedIssues was spawning a separate bd show subprocess for each
tracked issue. With 10 convoys x 5 issues = 50+ subprocesses per poll.

Solution: Use bd show batch capability (bd show id1 id2 id3 --json)
to fetch all issue details in a single call. Falls back to individual
lookups if the batch fails (e.g., invalid IDs).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 23:26:22 -08:00
gastown/polecats/valkyrie
39b3b150bd gt convoy create: Default --notify to mayor/
When Mayor creates a convoy, automatically default --notify to 'mayor/'
since the Mayor dispatched the work and should be notified when it lands.
This reduces flag boilerplate for the common case.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 22:36:43 -08:00
gastown/polecats/keeper
375f215f56 Remove broken slot set for convoy notify address (gt-733mx)
The `bd slot` command is for agent beads only. Convoy beads aren't agents,
so the slot set failed with exit status 1. The notify address is already
stored in the convoy's description, which is the intended persistence
mechanism.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 22:36:15 -08:00
beads/crew/wolf
e23b3b1955 Restore convoy add command and feed deduplication logic
Accidentally included staged reverts in previous commit. Restoring:
- convoyAddCmd for 'gt convoy add' command
- Event filtering/deduplication in feed model

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 21:18:59 -08:00
beads/crew/wolf
d72cb6b9cf Add gt worktree remove command and fix cross-rig worktree creation
- Add WorktreeAddExistingForce to git package (uses --force flag)
- Fix worktree creation: use force flag so main can be checked out
  in multiple worktrees (needed for cross-rig work)
- Implement 'gt worktree remove <rig>' with --force flag
- Refuse to remove worktrees with uncommitted changes unless forced

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 21:16:43 -08:00
gastown/polecats/testcat
12e6bf6a5d Add gt convoy add command for adding issues to existing convoys (gt-nq3pr)
Implements the 'add' subcommand to convoy that:
- Validates the convoy exists
- Automatically reopens closed convoys
- Adds 'tracks' dependency for each issue
- Warns but doesn't fail on issues that can't be added

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 21:14:39 -08:00
gastown/crew/joe
df46e75a51 Fix: Unknown subcommands now error instead of silently showing help
Parent commands (mol, mail, crew, polecat, etc.) previously showed help
and exited 0 for unknown subcommands like "gt mol foobar". This masked
errors in scripts and confused users.

Added requireSubcommand() helper to root.go and applied it to all parent
commands. Now unknown subcommands properly error with exit code 1.

Example before: gt mol unhook → shows help, exits 0
Example after:  gt mol unhook → "Error: unknown command "unhook"", exits 1

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 20:52:23 -08:00
Steve Yegge
210554163f Add --all flag to convoy list to show closed convoys 2025-12-30 19:27:55 -08:00
Steve Yegge
bf390dee86 Add cv- prefix and 🚚 emoji to convoy display 2025-12-30 19:09:18 -08:00
Steve Yegge
f8b030b7ca Clarify convoy vs swarm terminology in docs and code
- Convoy: Persistent tracking unit for batched work across rigs
- Swarm: Ephemeral workers on a convoy (no separate tracking)

Changes:
- docs/convoy.md: New comprehensive convoy documentation
- docs/swarm.md: Updated to explain ephemeral nature
- docs/reference.md: Replace swarm section with convoy commands
- internal/cmd/convoy.go: Clarify help text
- internal/cmd/swarm.go: Mark as deprecated

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:55:24 -08:00
Steve Yegge
5c289c2def Recover gt convoy CLI from orphaned commit (gt-frvun)
Cherry-picked from 77f9da07 - work that was done but never merged to main.
Found during orphan audit: 73 commits identified as potentially lost work.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:38:18 -08:00
Steve Yegge
be34002d96 Implement convoy --notify flag notification (gt-5tipl)
The --notify flag on gt convoy create was captured but never used.
This fix:

1. Stores the notify address in a bd slot when convoy is created
2. Adds 'gt convoy notify <convoy-id>' command that:
   - Reads the notify slot
   - Sends mail to the configured address with convoy completion details
   - Does nothing gracefully if no notification was configured

The convoy-cleanup formula can now call 'gt convoy notify {{convoy}}'
to trigger the configured notification when a convoy completes.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 16:52:37 -08:00
Steve Yegge
9f165d7c82 Fix SQL injection vulnerability in convoy.go (gt-frvun)
Add input validation for convoyID before using it in SQL query.
Issue IDs must match ^[a-zA-Z0-9_-]+$ to prevent injection attacks.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 14:14:46 -08:00
Steve Yegge
d98daed901 Add gt convoy create/status/list commands (gt-frvun)
Implements CLI for convoy management in Gas Town:
- gt convoy create <name> [issues...] - Creates convoy in town beads (hq-* prefix)
- gt convoy status [id] - Shows convoy progress and tracked issues
- gt convoy list - Lists all convoys with optional status filter

Convoys track issues across rigs using the 'tracks' relation type
and auto-close when all tracked issues complete.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 13:58:07 -08:00