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>
This commit is contained in:
Steve Yegge
2025-12-30 01:52:24 -08:00
parent 4f9bf643bd
commit 1d4b27cf06
4 changed files with 345 additions and 53 deletions

View File

@@ -44,26 +44,34 @@ func init() {
var feedCmd = &cobra.Command{
Use: "feed",
GroupID: GroupDiag,
Short: "Show real-time activity feed from beads",
Long: `Display a real-time feed of issue and molecule state changes.
Short: "Show real-time activity feed from beads and gt events",
Long: `Display a real-time feed of issue changes and agent activity.
By default, launches an interactive TUI dashboard with:
- Agent tree (top): Shows all agents organized by role with latest activity
- Event stream (bottom): Chronological feed you can scroll through
- Vim-style navigation: j/k to scroll, tab to switch panels, q to quit
Use --plain for simple text output (wraps bd activity).
The feed combines two event sources:
- Beads activity: Issue creates, updates, completions (from bd activity)
- GT events: Agent activity like patrol, sling, handoff (from .events.jsonl)
Use --plain for simple text output (wraps bd activity only).
Tmux Integration:
Use --window to open the feed in a dedicated tmux window named 'feed'.
This creates a persistent window you can cycle to with C-b n/p.
Event symbols:
+ created/bonded - New issue or molecule created
→ in_progress - Work started on an issue
✓ completed - Issue closed or step completed
✗ failed - Step or issue failed
⊘ deleted - Issue removed
+ created/bonded - New issue or molecule created
→ in_progress - Work started on an issue
✓ completed - Issue closed or step completed
✗ failed - Step or issue failed
⊘ deleted - Issue removed
👁 patrol_started - Witness began patrol cycle
⚡ polecat_nudged - Worker was nudged
🎯 sling - Work was slung to worker
🤝 handoff - Session handed off
MQ (Merge Queue) event symbols:
⚙ merge_started - Refinery began processing an MR
@@ -187,6 +195,12 @@ func runFeedDirect(workDir string, bdArgs []string) error {
// runFeedTUI runs the interactive TUI feed.
func runFeedTUI(workDir string) error {
// Must be in a Gas Town workspace
townRoot, err := workspace.FindFromCwdOrError()
if err != nil {
return fmt.Errorf("not in a Gas Town workspace: %w", err)
}
var sources []feed.EventSource
// Create event source from bd activity
@@ -202,6 +216,12 @@ func runFeedTUI(workDir string) error {
sources = append(sources, mqSource)
}
// Create GT events source (optional - don't fail if not available)
gtSource, err := feed.NewGtEventsSource(townRoot)
if err == nil {
sources = append(sources, gtSource)
}
// Combine all sources
multiSource := feed.NewMultiSource(sources...)
defer multiSource.Close()