Commit Graph

22 Commits

Author SHA1 Message Date
george
58207a00ec refactor(mrqueue): remove mrqueue package, use beads for MRs (gt-dqi)
Remove the mrqueue side-channel from gastown. The merge queue now uses
beads merge-request wisps exclusively, not parallel .beads/mq/*.json files.

Changes:
- Delete internal/mrqueue/ package (~830 lines removed)
- Move scoring logic to internal/refinery/score.go
- Update Refinery engineer to query beads via ReadyWithType("merge-request")
- Add MRInfo struct to replace mrqueue.MR
- Add ClaimMR/ReleaseMR methods using beads assignee field
- Update HandleMergeReady to not create duplicate queue entries
- Update gt refinery commands (claim, release, unclaimed) to use beads
- Stub out MQEventSource (no longer needed)

The Refinery now:
- Lists MRs via beads.ReadyWithType("merge-request")
- Claims via beads.Update(..., {Assignee: worker})
- Closes via beads.CloseWithReason("merged", mrID)
- Blocks on conflicts via beads.AddDependency(mrID, taskID)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 23:48:56 -08:00
Ryan Snodgrass
e1f2bb8b4b feat(ui): import comprehensive UX system from beads
Import beads' UX design system into gastown:

- Add internal/ui/ package with Ayu theme colors and semantic styling
  - styles.go: AdaptiveColor definitions for light/dark mode
  - terminal.go: TTY detection, NO_COLOR/CLICOLOR support
  - markdown.go: Glamour rendering with agent mode bypass
  - pager.go: Smart paging with GT_PAGER support

- Add colorized help output (internal/cmd/help.go)
  - Group headers in accent color
  - Command names styled for scannability
  - Flag types and defaults muted

- Add gt thanks command (internal/cmd/thanks.go)
  - Contributor display with same logic as bd thanks
  - Styled with Ayu theme colors

- Update gt doctor to match bd doctor UX
  - Category grouping (Core, Infrastructure, Rig, Patrol, etc.)
  - Semantic icons (✓ ⚠ ✖) with Ayu colors
  - Tree connectors for detail lines
  - Summary line with pass/warn/fail counts
  - Warnings section at end with numbered issues

- Migrate existing styles to use ui package
  - internal/style/style.go uses ui.ColorPass etc.
  - internal/tui/feed/styles.go uses ui package colors

Co-Authored-By: SageOx <ox@sageox.ai>
2026-01-09 22:46:06 -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
dave
388a02d3ab fix: convoy TUI uses wrong column name for dependency type
The TUI query used 'dependency_type' but the actual column is 'type'.
This caused expand to show nothing when pressing Enter on a convoy.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 01:09:00 -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
40f3a8dfd2 fix(convoy-tui): Address code review issues
- Add convoy ID validation to prevent SQL injection
- Add 5-second timeouts to all subprocess calls
- Batch issue lookups to eliminate N+1 query pattern
- Fix truncate() to handle multi-byte UTF-8 characters

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 13:22:13 -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/jack
f3f46de20d Add 5-second timeouts to convoy panel subprocess calls
Adds context timeouts to bd and sqlite3 calls in the convoy panel TUI.
If these commands hang, the TUI will no longer freeze - it will timeout
after 5 seconds and return empty/error state.

Functions updated:
- listConvoys: bd list with context timeout
- getTrackedIssueStatus: sqlite3 query with context timeout
- getIssueStatus: bd show with context timeout

(gt-14xej)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 23:25:58 -08:00
gastown/crew/joe
f464f87d5b Consolidate duplicate formatAge functions in feed TUI (gt-798p0) 2025-12-30 23:24:20 -08:00
gastown/crew/gus
4178940d39 Fix SQL injection and refresh scheduling in convoy panel
- Add convoyID validation with regex pattern ^hq-[a-zA-Z0-9-]+$
  to prevent SQL injection in getTrackedIssueStatus (gt-ur4c4)
- Fix duplicate refresh scheduling: tick schedules fetch, fetch
  schedules next tick (gt-yqfrx)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 23:23:26 -08:00
gastown/crew/gus
31c4a222bc Add convoy dashboard panel to gt feed TUI
Adds a third panel to the feed TUI showing:
- In-progress convoys with progress bars (completed/total)
- Recently landed convoys (last 24h) with time since landing

Features:
- Panel cycles with tab: tree -> convoy -> feed
- Direct access via 1/2/3 number keys
- Auto-refresh every 10 seconds
- Styled progress indicators (●●○○)

The convoy panel bridges the gap between "WHO is working" (agent tree)
and "WHAT is happening" (event feed) by showing "WHAT IS SHIPPING".

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 23:17:41 -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/crew/joe
60ef12305c Fix gt feed: filter empty bead IDs and deduplicate rapid updates
Two issues with the feed reported by user:
1. Empty entries showing "→  updated" with no bead ID
2. Same bead updated 8 times in 2 seconds (when adding multiple deps)

Fixes:
- Filter out update events with empty Target (bead ID)
- Deduplicate rapid updates to same bead within 2 second window

Root cause of empty IDs is in beads daemon (filed bd-sco6).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 21:14:07 -08:00
Steve Yegge
1d4b27cf06 Wire witness patrol events to gt feed display
Add support for displaying gt events (from ~/gt/.events.jsonl) in the
gt feed TUI, including witness patrol activity:

- Add event symbols for patrol events (patrol_started, patrol_complete,
  polecat_checked, polecat_nudged, escalation_sent), merge events, and
  general gt events (sling, hook, handoff, mail, spawn, etc.)

- Create GtEventsSource that parses .events.jsonl format with proper
  extraction of rig/role from actor paths and human-readable message
  generation from event payloads

- Create CombinedSource that merges multiple event sources (bd activity
  and gt events) using fan-in pattern

- Update feed command to use combined source for TUI mode

- Add appropriate styling for new event types (nudges/escalations in
  red, patrol complete in green, etc.)

Example gt feed output now shows:
  09:45 ✓ witness: All polecats healthy
  09:44  witness: nudged nux (idle 10m)
  09:40 🎯 mayor: slung gt-rbncw to furiosa

(gt-rbncw)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 01:55:09 -08:00
Steve Yegge
4f9bf643bd feat: Wire MQ lifecycle events to gt feed display (gt-lak31)
- Add MQ event types and logging in mrqueue/events.go
- Have refinery emit merge_started, merged, merge_failed, merge_skipped events
- Create MQEventSource to read from mq_events.jsonl
- Add MultiSource to combine events from bd activity and MQ events
- Add color coding: green for merged, red for failed
- Update feed help with MQ event symbols

Events are stored in .beads/mq_events.jsonl and displayed in the feed TUI
with appropriate symbols and colors.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 01:45:04 -08:00
Steve Yegge
f9e820985d feat: Filter agent session molecule noise from activity feed
Agent session molecules (gt-gastown-crew-joe, gt-gastown-witness, etc.)
update frequently for status tracking, creating noisy entries in the
activity feed. This change:

- Adds IsAgentSessionBead() to identify agent session beads
- Filters out "update" events for agent sessions from the event feed
- Still updates the agent tree so status is visible there
- Still shows create/complete/fail/delete events for agents

The filtering happens in addEvent() in the TUI feed model. Agent session
updates are identified by parsing the bead ID pattern and checking for
known agent roles (mayor, deacon, witness, refinery, crew, polecat).

Resolves: gt-sb6m4

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:42:57 -08:00
Steve Yegge
c92b11d1bd feat: Standardize agent bead naming to prefix-rig-role-name (gt-zvte2)
Implements canonical naming convention for agent bead IDs:
- Town-level: gt-mayor, gt-deacon (unchanged)
- Rig-level: gt-<rig>-witness, gt-<rig>-refinery (was gt-witness-<rig>)
- Named: gt-<rig>-crew-<name>, gt-<rig>-polecat-<name> (was gt-crew-<rig>-<name>)

Changes:
- Added AgentBeadID helper functions to internal/beads/beads.go
- Updated all ID generation call sites to use helpers
- Fixed session parsing in theme.go, statusline.go, agents.go
- Updated doctor check and fix to use canonical format
- Updated tests for new format

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:54:37 -08:00
Steve Yegge
f14483fc3f fix: Remove brackets from timestamp 2025-12-28 17:08:45 -08:00
Steve Yegge
56ae461f68 fix: Shorten timestamp to HH:MM in feed TUI 2025-12-28 16:46:17 -08:00
Steve Yegge
17b892b196 fix: Code review fixes for TUI feed
- Return *Model from NewModel() so SetEventChannel works
- Use sync.Once for safe channel close on quit
- Use pointer receivers consistently throughout
- Capture channels in closure to prevent race
- Fix indent panic in renderAgent when indent < 2
- Remove unused filterActive and err fields

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:33:47 -08:00
Steve Yegge
c7da650f94 feat: Add charmbracelet TUI for gt feed (gt-u7dxq)
- Add bubbletea and bubbles dependencies
- Create internal/tui/feed package with:
  - model.go: Main bubbletea model with agent tree and event stream
  - view.go: Rendering logic with lipgloss styling
  - keys.go: Vim-style key bindings (j/k, tab, /, q)
  - styles.go: Color palette and component styles
  - events.go: Event source from bd activity
- Update gt feed to use TUI by default (--plain for text mode)
- TUI features: agent tree by role, event stream, keyboard nav

Closes gt-be0as, gt-lexye, gt-1uhmj

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

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