7 Commits

Author SHA1 Message Date
nux
692d6819f2 feat(crash): improve crash logging and mass death detection
Add comprehensive crash logging improvements to help diagnose mass session death events:

- Add TypeSessionDeath and TypeMassDeath event types for feed visibility
- Log pre-death events before killing sessions (who killed, why)
- Add mass death detection in daemon (3+ deaths in 30s triggers alert)
- Add macOS crash report check in gt doctor
- Support session death events in townlog and feed curator

Closes hq-kt1o6

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 14:11:09 -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
Steve Yegge
1bf2b54773 Add witness activity events to gt feed (gt-nfdyl)
Implement activity event emission for witness patrol operations:
- patrol_started: When witness begins patrol cycle
- polecat_checked: When witness checks a polecat
- polecat_nudged: When witness nudges a stuck polecat
- escalation_sent: When witness escalates to Mayor/Deacon
- patrol_complete: When patrol cycle finishes

Also adds refinery merge queue events for future use:
- merge_started, merge_complete, merge_failed, queue_processed

New command: `gt activity emit <event-type>` allows agents to emit
events from CLI. Events write to ~/gt/.events.jsonl for gt feed.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:52:38 -08:00
Steve Yegge
2fb616b0b7 feat: Add callbacks command for handling agent messages (gt-eph-5c8)
Implements `gt callbacks process` for Mayor/Deacon patrol to handle
callbacks from agents:

- POLECAT_DONE: Log polecat completion
- MERGE_COMPLETED: Close source issue, log merge
- MERGE_REJECTED: Log rejection reason
- HELP/ESCALATION: Forward to overseer
- SLING_REQUEST: Log sling request for spawn
- WITNESS_REPORT: Log rig health status
- REFINERY_REPORT: Log queue status

Also adds EventCallback to townlog for callback processing events.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:45:35 -08:00
Steve Yegge
3421fe9303 Remove dead code: splitLines loop, unused methods (gt-2g130)
- polecat.go: Remove unreachable first loop in splitLines (was using filepath.SplitList incorrectly)
- townlog/logger.go: Remove unused Event.JSON() method and json import
- lock/lock.go: Remove unused ErrStaleLock error variable
- refinery/manager.go: Remove unused getTestCommand() method

Note: witness.StatePaused is actually used by cmd/witness.go, not dead code.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 17:13:34 -08:00
Steve Yegge
2117eb66f5 feat: Add tmux crash detection hooks (gt-i9s7o)
- Add SetPaneDiedHook to tmux package for crash detection
- Add gt log crash subcommand for hook callback
- Set pane-died hook when starting polecat sessions
- Distinguish exit types: 0=done, 130=kill (Ctrl+C), other=crash
- Rename townlog/townlog.go to townlog/logger.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 16:18:44 -08:00
Steve Yegge
e2b8f16c48 Implement town activity logging (gt-ewzon)
Add centralized logging for Gas Town agent lifecycle events:
- spawn: new agent created
- wake: agent resumed
- nudge: message injected
- handoff: agent handed off
- done: agent finished work
- crash: agent exited unexpectedly
- kill: agent killed intentionally

Implementation:
- Add internal/townlog package with LogEvent() function
- Log to ~/gt/logs/town.log with human-readable format
- Add gt log command to view/tail/filter logs
- Integrate logging into spawn, nudge, handoff, done, stop, session commands

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 15:51:54 -08:00