Commit Graph

688 Commits

Author SHA1 Message Date
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
jack
29058f321c refactor(commands): provision slash commands at town-level only (gt-7x274)
- gt install now creates ~/gt/.claude/commands/ with all commands
- Removed per-workspace provisioning from crew/polecat managers
- Updated bd doctor to check town-level instead of per-workspace
- All agents inherit via Claude directory traversal

This eliminates duplicate /handoff skills in the picker.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 15:49:53 -08:00
Steve Yegge
4ca430d628 feat(mail): Accept multiple message IDs in gt mail archive (#82)
Update the archive command to accept variadic arguments like bd close,
allowing users to archive multiple messages in a single command.

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 15:47:30 -08:00
joe
696573e644 Bump version to 0.1.2 2026-01-03 15:10:20 -08:00
joe
4bcf50bf1c Revert to simple gt-mayor/gt-deacon session names
Reverts the session naming changes from PR #70. Multi-town support
on a single machine is not a real use case - rigs provide project
isolation, and true isolation should use containers/VMs.

Changes:
- MayorSessionName() and DeaconSessionName() no longer take townName parameter
- ParseSessionName() handles simple gt-mayor and gt-deacon formats
- Removed Town field from AgentIdentity and AgentSession structs
- Updated all callers and tests

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 14:33:24 -08:00
jack
d3e47221ac fix(rig): improve UX for rig creation (#7)
- Add progress feedback during slow clone operations (30+ seconds)
- Fix README Quick Start to match actual workflow (--git flag, crew add)
- Update install output to use 'gt mayor attach' consistently
- Clarify "Next steps" wording in rig add output

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 13:54:02 -08:00
max
915f77ea03 feat(ci): Add integration test job; refactor crew startup to use beacon prompt
CI: Add integration test job that runs go test -tags=integration for
install, rig, and beads routing tests.

Crew lifecycle: Pass startup beacon as Claude's initial prompt instead
of nudging after startup. Removes timing-dependent sleep/nudge sequence.
Also removes redundant SetEnvironment calls (env vars already exported
in BuildCrewStartupCommand).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 12:58:27 -08:00
markov-kernel
e7145cfd77 fix: Make Mayor/Deacon session names include town name
Session names `gt-mayor` and `gt-deacon` were hardcoded, causing tmux
session name collisions when running multiple towns simultaneously.

Changed to `gt-{town}-mayor` and `gt-{town}-deacon` format (e.g.,
`gt-ai-mayor`) to allow concurrent multi-town operation.

Key changes:
- session.MayorSessionName() and DeaconSessionName() now take townName param
- Added workspace.GetTownName() helper to load town name from config
- Updated all callers in cmd/, daemon/, doctor/, mail/, rig/, templates/
- Updated tests with new session name format
- Bead IDs remain unchanged (already scoped by .beads/ directory)

Fixes #60

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 21:37:05 +01:00
medley
eabb1c5aa6 fix(done): detect default branch instead of hardcoding 'main' (#42)
Adds RemoteDefaultBranch() to git.go that detects the repo's actual
default branch by checking origin/HEAD, then falling back to checking
for origin/master or origin/main.

Updates done.go to use this detection instead of hardcoded "main":
- Line 168: CommitsAhead now uses detected default branch
- Line 173: Error message uses detected branch name
- Line 187: Target branch defaults to detected branch

Fixes repos using 'master' as default branch (pre-2020 repos).

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Steve Yegge <steve.yegge@gmail.com>
2026-01-03 11:53:38 -08:00
mayor
aaa356aeb6 Merge: toast-mjxpchjl - Rename session gt-deacon-boot to fix prefix collision 2026-01-03 11:52:16 -08:00
nux
cf53e2852e feat(session): Include session ID in PropulsionNudge for /resume picker
PropulsionNudgeForRole now accepts a workDir parameter and reads
session ID from .runtime/session_id to append [session:xxx] to the
nudge message. This enables Claude Code's /resume picker to discover
Gas Town sessions.

(gt-u49zh)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 11:51:30 -08:00
Mike Lady
3488933cc2 Add 'gt dashboard' CLI command (hq-s1bg) (#65)
* Add LastActivity calculation for convoy dashboard (hq-x2xy)

Adds internal/activity package with color-coded activity tracking:
- Green: <2 minutes (active)
- Yellow: 2-5 minutes (stale)
- Red: >5 minutes (stuck)

Features:
- Calculate() function returns Info with formatted age and color class
- Helper methods: IsActive(), IsStale(), IsStuck()
- Handles edge cases: zero time, future time (clock skew)

Tests: 8 test functions with 25 sub-tests covering all thresholds.

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

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

* Add convoy dashboard HTML template with Last Activity (hq-fq1g)

Adds internal/web package with convoy dashboard template:
- convoy.html with Last Activity column and color coding
- Green (<2min), Yellow (2-5min), Red (>5min) activity indicators
- htmx auto-refresh every 30 seconds
- Progress bars for convoy completion
- Status indicators for open/closed convoys
- Empty state when no convoys

Also includes internal/activity package (dependency from hq-x2xy):
- Calculate() returns Info with formatted age and color class
- Helper methods: IsActive(), IsStale(), IsStuck()

Tests: 6 template tests + 8 activity tests, all passing.

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

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

* Add convoy list handler with activity data (hq-3edt)

Adds HTTP handler that wires convoy dashboard template to real data:
- ConvoyHandler: HTTP handler for GET / rendering convoy dashboard
- LiveConvoyFetcher: Fetches convoys from beads with activity data
- ConvoyFetcher interface: Enables mocking for tests

Features:
- Fetches open convoys from town beads
- Calculates progress (completed/total) from tracked issues
- Gets Last Activity from worker agent beads
- Color codes activity: Green (<2min), Yellow (2-5min), Red (>5min)

Includes dependencies (not yet merged):
- internal/activity: Activity calculation (hq-x2xy)
- internal/web/templates: HTML template (hq-fq1g)

Tests: 5 handler tests + 6 template tests + 8 activity tests = 19 total

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

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

* Add 'gt dashboard' CLI command (hq-s1bg)

Add dashboard command to start the convoy tracking web server.

Usage: gt dashboard [--port=8080] [--open]

Features:
- --port: Configurable HTTP port (default 8080)
- --open: Auto-open browser on start
- Cross-platform browser launch (darwin/linux/windows)
- Graceful workspace detection

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

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 11:49:42 -08:00
Steve Yegge
7afcea935b Merge pull request #61 from danshapiro/fix/rig-beads-dir
feat: allow local repo reference clones to save disk
2026-01-03 11:48:58 -08:00
mayor
e7994d98f7 feat(prime): Add --hook flag for LLM runtime session handling
Enables gt prime to receive session metadata from LLM runtime hooks.
When called with --hook, reads JSON from stdin containing session_id
and persists it to .runtime/session_id for use by PropulsionNudge.

- Add --hook flag for hook mode
- Parse Claude Code session JSON from stdin
- Support GT_SESSION_ID environment variable fallback
- Persist session ID to .runtime/session_id

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 11:30:28 -08:00
Dan Shapiro
4727f5079f feat: allow local repo reference clones to save disk
Use git --reference-if-able when a local repo is provided so rigs and crew share objects without changing remotes.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 09:27:58 -08:00
rictus
175c4d3996 test: Add integration tests for beads routing and redirects (gt-htlmp.4)
Validates:
- bd show routes to correct rig based on issue ID prefix
- bd show hq-* routes to town beads
- Redirect chains (.beads/redirect) resolve correctly
- bd list works from polecat/crew directories with redirects
- Prefix conflicts are detected in routes.jsonl
- Routes loading, appending, and removal work correctly
- GetPrefixForRig returns correct prefix for rig name

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 18:56:45 -08:00
toast
9dcbdf8106 fix(boot): Rename session gt-deacon-boot → gt-boot to fix prefix collision
The tmux session name "gt-deacon-boot" was causing HasSession("gt-deacon")
to return true due to tmux prefix matching behavior. This made the daemon
think the Deacon was running when only Boot was active, and caused commands
targeting "gt-deacon" to be sent to Boot session instead.

The fix renames Boot session from "gt-deacon-boot" to "gt-boot", which
has no prefix overlap with "gt-deacon".

Fixes: gt-sgzsb

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 18:56:40 -08:00
valkyrie
63d5502b4b fix(status): Reconcile tmux session state with bead state
The gt status command now properly reconciles the tmux session
existence with the agent bead state to surface mismatches:

- If session exists AND bead says running/idle → "running"
- If session exists BUT bead says stopped/dead → "running [bead: <state>]"
- If session gone BUT bead says running/idle → "running [dead]"
- If session gone AND bead says stopped → "stopped"

This surfaces the key mismatch case where a tmux session is actually
running but the bead state incorrectly says "stopped" or "dead".

Fixes: gt-doih4

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 18:55:13 -08:00
keeper
354219033a feat: Add 'ensure' semantics to witness/refinery start commands
gt witness start and gt refinery start now detect zombie sessions
(tmux alive but Claude dead) and automatically kill and recreate them.

This makes the start commands idempotent:
- If no session exists → create new session
- If session exists and healthy → do nothing (already running)
- If session exists but zombie → kill and recreate

Previously users had to manually run stop then start, or use restart.

Closes: gt-ekc5u

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 18:53:52 -08:00
cheedo
49116f2deb feat(daemon): Add binary age detection to status command
Shows binary modification time in gt daemon status and warns when
the binary is newer than the running process, suggesting a restart.
This helps detect when bug fixes or new features aren't active because
the daemon is running old code.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 18:53:13 -08:00
capable
fa26265b32 test: Add integration tests for gt rig add command
Add comprehensive integration tests that validate gt rig add:
- TestRigAddCreatesCorrectStructure: Verify directory structure
- TestRigAddInitializesBeads: Verify beads prefix initialization
- TestRigAddUpdatesRoutes: Verify routes.jsonl is updated
- TestRigAddUpdatesRigsJson: Verify rigs.json is updated
- TestRigAddDerivesPrefix: Verify prefix derivation from name
- TestRigAddCreatesRigConfig: Verify config.json content
- TestRigAddCreatesAgentDirs: Verify agent state files
- TestRigAddRejectsInvalidNames: Verify name validation

Uses //go:build integration tag per design doc.
Run with: go test -tags=integration ./internal/cmd -run TestRigAdd

(gt-htlmp.3)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 18:31:15 -08:00
dementus
8f6e2d2174 test: Add integration tests for gt install command
- TestInstallCreatesCorrectStructure: validates directory structure
  (mayor/, rigs/, CLAUDE.md) and config files (town.json, rigs.json)
- TestInstallBeadsHasCorrectPrefix: verifies beads uses hq- prefix
- TestInstallIdempotent: tests --force flag behavior
- TestInstallNoBeadsFlag: tests --no-beads option

Run with: go test -tags=integration ./internal/cmd/ -run TestInstall

(gt-htlmp.2)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 18:30:30 -08:00
slit
89785378bf feat(costs): Wire up gt costs record to Stop hook
Add Claude Code Stop hook that automatically records session costs when
sessions end. The hook calls `gt costs record` which now can derive the
session name from GT_* environment variables (GT_RIG, GT_POLECAT, GT_CREW,
GT_ROLE).

Changes:
- Add deriveSessionName() to infer tmux session name from environment
- Add Stop hook to settings-autonomous.json and settings-interactive.json
- Add unit tests for deriveSessionName function

When a Gas Town session ends, the Stop hook fires and records the session
cost as a bead event. Costs then appear in `gt costs --today` output.

Closes: gt-ntzhc

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 18:29:25 -08:00
nux
f7839c2724 feat(refinery): Non-blocking delegation via bead-gates (gt-hibbj)
When merge conflicts occur, the Refinery now creates a conflict resolution
task and blocks the MR on that task, allowing the queue to continue to the
next MR without waiting.

Changes:
- Add BlockedBy field to mrqueue.MR for tracking blocking tasks
- Update handleFailureFromQueue to set BlockedBy after creating conflict task
- Add ListReady method to mrqueue that filters out blocked MRs
- Add ListBlocked method for monitoring blocked MRs
- Add IsBeadOpen, ListReadyMRs, ListBlockedMRs helpers to Engineer
- Add 'gt refinery ready' command (unclaimed AND unblocked MRs)
- Add 'gt refinery blocked' command (shows blocked MRs)

When the conflict resolution task closes, the MR unblocks and re-enters
the ready queue for processing.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 18:25:15 -08:00
joe
c3e83a3d09 Fix remaining worker startups for gt seance metadata
- startCrewMember: now uses BuildCrewStartupCommand (was GetRuntimeCommand)
- refinery/manager.go: now uses BuildAgentStartupCommand (was GetRuntimeCommand)

Both now properly inject BD_ACTOR and GT_ROLE so seance can identify
sessions correctly. This completes the seance metadata fix started in
the previous commit.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 18:09:42 -08:00
joe
49be394eef Fix crew startup to inject metadata for gt seance
gt crew start was using GetRuntimeCommand which doesn't set BD_ACTOR,
GT_RIG, GT_CREW, etc. This caused seance to misidentify crew sessions
(showing as "mayor" instead of their actual identity).

Now uses BuildCrewStartupCommand like gt crew restart does, ensuring
proper env var injection for session identification. (gt-jwxgb)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:42:27 -08:00
toast
9683744b53 feat: Add 'spawn' as alias for 'start' subcommand across roles
Added 'spawn' as an alias for 'start' in the following commands:
- gt witness start → also gt witness spawn
- gt refinery start → also gt refinery spawn
- gt deacon start → also gt deacon spawn
- gt crew start → also gt crew spawn

This improves discoverability since agents are guessing 'spawn'
when trying to start roles.

Note: gt polecat does not have a 'start' command - polecat spawning
is handled via 'gt sling'.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:30:24 -08:00
rictus
45265f779d feat(sling): Support batch slinging multiple beads to a rig
Allows slinging multiple beads in a single command:
  gt sling gt-abc gt-def gt-ghi gastown

Each bead gets its own freshly spawned polecat. This parallelizes
work dispatch without running gt sling N times manually.

Changes:
- Updated Args from RangeArgs(1,2) to MinimumNArgs(1)
- Added batch mode detection when len(args)>2 and last arg is a rig
- Added runBatchSling() to handle multiple beads with progress tracking

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:29:52 -08:00
dag
7919129ff4 feat(rig): Add 'gt rig restart' for multi-rig restart support
Adds 'gt rig restart <rig>...' command that stops then starts witness
and refinery for one or more rigs. Supports --force and --nuclear flags
like the existing start/stop commands. (gt-s7t1h)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:29:21 -08:00
slit
d4eed2dcf2 feat(crew): Provision .claude/commands/ for crew and polecat workspaces (gt-jhr85)
When adding a crew member with 'gt crew add' or spawning a polecat,
provision the .claude/commands/ directory with standard slash commands
like /handoff. This ensures all agents have Gas Town utilities even if
the source repo does not have them tracked.

Changes:
- Add embedded commands templates (internal/templates/commands/)
- Add ProvisionCommands() to templates package
- Call ProvisionCommands from crew and polecat managers
- Add gt doctor commands-provisioned check with --fix support
2026-01-02 17:28:40 -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
nux
8517ff0650 feat(mq): Add priority-ordered queue display and processing (gt-si8rq.6)
Implements priority scoring for merge queue ordering:

## Changes to gt mq list
- Add SCORE column showing priority score (higher = process first)
- Sort MRs by score descending instead of simple priority
- Add CONVOY column showing convoy ID if tracked

## New gt mq next command
- Returns highest-score MR ready for processing
- Supports --strategy=fifo for FIFO ordering fallback
- Supports --quiet for just printing MR ID
- Supports --json for programmatic access

## Changes to Refinery
- Queue() now sorts by priority score instead of simple priority
- Uses ScoreMR from mrqueue package for consistent scoring

## MR Fields Extended
- Added retry_count, last_conflict_sha, conflict_task_id
- Added convoy_id, convoy_created_at for convoy tracking
- These fields feed into priority scoring function

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:18:27 -08:00
furiosa
8feb27d44c fix(nuke): Check content on main, not just commit SHAs
After squash merge, polecat branches have different commit SHAs than main
even though the content is identical. This was causing false "unpushed
commits" warnings during nuke safety checks.

Now uses `git diff` to verify if content differs from main, rather than
just counting commits ahead. If diff is empty, content is on main
(via squash merge) and nuke is safe. (gt-fo9iz)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 17:11:11 -08:00
nux
2ad83421c5 feat(done): Add conflict resolution tracking fields to MR beads (gt-si8rq.7)
Add retry_count, last_conflict_sha, and conflict_task_id fields to MR bead
descriptions when created via `gt done`. These are initialized at creation
time and will be updated by the Refinery when handling merge conflicts.

- retry_count: 0 (number of conflict-resolution cycles)
- last_conflict_sha: null (SHA of main when conflict occurred)
- conflict_task_id: null (link to conflict-resolution task if any)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 16:46:10 -08:00
furiosa
f8b650cf82 feat(done): Add --phase-complete flag for gate-based phase handoffs
Add support for signaling phase completion when a polecat needs to wait
on a gate before continuing. The --phase-complete flag with --gate ID
allows polecats to hand off control while awaiting external conditions.

Changes:
- done.go: Add --phase-complete and --gate flags, PHASE_COMPLETE exit type
- protocol.go: Add Gate field to PolecatDonePayload
- handlers.go: Handle PHASE_COMPLETE by recycling session (keep worktree)
- beads.go: Add AddGateWaiter method for gate registration

This enables multi-phase molecule workflows with async coordination (bd-gxb4)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 16:43:50 -08:00
Steve Yegge
535bb8e4c2 Merge pull request #34 from kustrun/fix/init-bugs
Fix init bugs when setting first gastown
2026-01-02 16:02:39 -08:00
mayor
c9d6c70e03 fix(sling): Add trailing slash to town-level agent IDs
Town-level agents (mayor/, deacon/) need trailing slash to match
addressToIdentity() normalization.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 14:03:56 -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
kustrun
a0a47676f9 fix(sling): Set BEADS_DIR for accessing hq-* beads from polecat worktree
When running bd update commands for hq-* beads from a polecat worktree,
the redirect mechanism only exposes gt-* beads. This fix sets BEADS_DIR
to the town-level .beads directory so hq-* beads are accessible.

Also adds NewWithBeadsDir() constructor to beads package for explicit
cross-database access when needed.
2026-01-02 23:02:42 +01:00
capable
579c11379a fix(polecat): Require rig/polecat format for nuke and remove commands
Previously, when running `gt polecat nuke <name> <rig>`, the parseAddress
function would infer the rig from cwd for each argument, causing a plain
rig name to be misinterpreted as a polecat name. For example, running from
a gastown directory:

  gt polecat nuke angharad gastown --force

Would try to nuke both gastown/angharad AND gastown/gastown.

Now both runPolecatNuke and runPolecatRemove validate that each address
argument contains "/" before parsing, enforcing the documented
`<rig>/<polecat>` format and preventing this misinterpretation.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 14:01:58 -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
nux
a440a7ff93 feat(mail): Add --all flag to gt mail clear for agent ergonomics (gt-105q3)
The command already clears all messages by default, but agents naturally
try --all when they want to clear everything. Adding it as a no-op flag
improves discoverability and natural usage patterns.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:47:34 -08:00
kustrun
58e7c96936 fix(sling): Use target's working directory for bd update commands
When slinging to an existing polecat, the bd update command was running
from town root which doesn't support prefix-based routing for writes.

Fix: Capture the target agent's working directory from resolveTargetAgent
and use it as hookWorkDir. This ensures bd update runs from the polecat's
worktree where the .beads/redirect file enables routing to the correct
database.

Also fixed the self-sling case to capture and use selfWorkDir.
2026-01-02 22:44:59 +01:00
kustrun
94857fc913 fix(session): Auto-accept Claude bypass permissions warning dialog
When Claude starts with --dangerously-skip-permissions, it shows a warning
dialog requiring Down+Enter to accept. This blocked automated polecat and
agent startup.

Added AcceptBypassPermissionsWarning() to tmux package that:
- Checks if the warning dialog is present by capturing pane content
- Only sends Down+Enter if "Bypass Permissions mode" text is found
- Avoids interfering with sessions that don't show the warning

Updated all Claude startup locations:
- session/manager.go (polecat sessions)
- cmd/up.go (mayor, witness, crew, polecat cold starts)
- daemon/daemon.go (crashed polecat restarts)
- daemon/lifecycle.go (role session starts)
2026-01-02 22:44:58 +01:00
kustrun
3c4190597f fix(session): Set BEADS_DIR to town-level beads for polecat hooks
Polecats need access to town-level beads (hq- prefix) for hooks and
convoys. Update session manager to set BEADS_DIR to town root .beads/
instead of rig-level .beads/.

Also update mail.go's findLocalBeadsDir() to respect the BEADS_DIR
environment variable, which is necessary for polecats using
redirect-based beads access.
2026-01-02 22:44:58 +01:00
kustrun
8133cc36b7 fix(sling): Run bd commands from polecat worktree for proper routing
When slinging work to a polecat, run bd commands from the polecat's
worktree directory instead of town root. This enables redirect-based
routing to work correctly since the polecat's .beads/redirect file
points to the canonical database location.

Adds hookWorkDir variable to track the polecat's clone path and passes
it to updateAgentHookBead for proper beads access.
2026-01-02 22:44:58 +01:00
kustrun
b4a6f599ac fix(beads): Use conditional routing based on source repo beads location
Route to the correct beads location based on whether the source repo
has .beads/ tracked in git:
- If source has .beads/ tracked: route to mayor/rig/.beads
- Otherwise: route to rig root .beads/ (created by initBeads)

Updates both route registration in rig.go and polecat manager's
NewManager/setupSharedBeads to use consistent conditional logic.
2026-01-02 22:44:58 +01:00
furiosa
ff37d2213a feat(done): Add --exit flag for session self-termination (gt-lynar)
Add --exit flag to `gt done` that terminates the Claude session
immediately after submitting the MR to the merge queue. This prevents
polecats from sitting idle (and wasting money) while waiting for the
Witness to kill them.

Changes:
- Rename existing --exit flag to --status (for exit type)
- Add new --exit boolean flag for session self-termination
- Update docs and help text to reflect new flag names

Usage: gt done --exit

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 13:43:32 -08:00
capable
aafc717113 feat(costs): Use beads for session cost tracking instead of JSONL (gt-f7jxr)
- Updated `gt costs record` to create session.ended events in beads
- Updated `gt costs --today/--week` queries to use bd instead of JSONL
- Removed JSONL ledger support (getLedgerPath, readLedger, WriteLedgerEntry)
- Session costs now stored with event_kind, actor, target, and payload fields
- Filed bd-xwvo for beads bug where --rig flag loses event fields

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

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