Commit Graph

322 Commits

Author SHA1 Message Date
Steve Yegge
58cf789eee revert: let project beads config control sync-branch
The sync-branch setting is up to the project's .beads/config.yaml,
not something Gas Town should force. Projects can use bd doctor --fix
to configure sync-branch if they want multi-clone coordination.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 15:46:18 -08:00
Steve Yegge
317caace5e fix: auto-configure sync-branch for rig beads
New rigs now get sync-branch: beads-sync in their .beads/config.yaml
automatically. This enables multi-clone coordination for polecats,
crew members, and refinery.

Also added gt doctor check (beads-sync-branch) to verify existing rigs
have sync-branch configured, with --fix support.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 15:42:45 -08:00
Steve Yegge
ded1ffba0b docs: add two-level beads architecture documentation
Add clear explanations of the town-level vs rig-level beads architecture:
- Town beads (~/gt/.beads): HQ coordination, no sync-branch
- Rig beads (in git clones): project work, uses beads-sync branch
- Clarify that rig-level .beads at container is gitignored

Updated:
- docs/architecture.md: New 'Two-Level Beads Architecture' section
- CLAUDE.md: Enhanced existing section with table and sync-branch info
- templates/roles/*.tmpl: Added beads architecture to crew, polecat, mayor

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 15:37:52 -08:00
Steve Yegge
be0f77324f fix(refinery): avoid race condition in foreground mode
In foreground mode, skip the tmux session check since we are likely
running inside the session that background mode created. Only check
PID to avoid self-detection.

Fixes the issue where gt refinery start gastown --foreground would
detect its own tmux session as already running.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 15:16:56 -08:00
Steve Yegge
91a0f3b80f feat: rename harness to HQ throughout docs and code (gt-a41)
The "hq-" prefix for town-level beads revealed that "HQ" (headquarters)
is a better name than "harness" for the top-level Gas Town structure.

- Renamed docs/harness.md to docs/hq.md with updated content
- Updated all documentation references in architecture.md and bootstrap.md
- Updated CLI help text and user-facing messages in install.go
- Updated gitinit.go with HQGitignore constant and HQ terminology
- Updated molecule templates in builtin_molecules.go
- Kept InitGitForHarness function name for backwards compatibility

HQ is more intuitive (where the mayor sits), fits the Mad Max aesthetic,
matches the beads prefix (hq-*), and is self-documenting.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 14:24:49 -08:00
Steve Yegge
afee8bba17 docs: use hq- prefix for town-level beads
Updated beads-hygiene plugin spec to use 'hq-' (headquarters) instead
of 'stevetown-'. Short, visually distinct from rig prefixes, and
semantically clear.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:48:32 -08:00
Steve Yegge
42e393627d docs: Update docs to reflect molecule-first paradigm (gt-nam3)
- Add molecule-first paradigm note at top of architecture.md
- Update all spawn examples to include --molecule flag
- Add "Config vs Molecule" section with cognition principle
- Add policy-to-molecule escalation note in federation-design.md
- Update role templates (mayor, witness) with molecule usage

Key message: Gas Town spawns workers on molecules, not just issues.
The issue is seed data; the molecule defines the workflow.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:44:43 -08:00
Steve Yegge
39758e6cf3 docs: add beads-hygiene plugin spec
Detects and fixes cross-pollution between Gas Town's two-level beads
architecture (town-level vs rig-level). Workers sometimes get confused
about which database they're in, creating issues at the wrong level.

The plugin scans for:
- Prefix mismatches (wrong prefix for location)
- Cross-level dependency references
- Agent identity/context confusion
- Misfiled issues that should be moved

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:37:49 -08:00
Steve Yegge
1e62d37b1e Merge fix/spawn-beads-path: add gt nudge command
Key changes:
- Add gt nudge command for reliable Claude session messaging
- spawn.go now uses NudgeSession instead of SendKeysDebounced
- Fix templates test to match actual deacon template text

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:30:30 -08:00
Steve Yegge
11fe4dddc5 fix(handoff): Use actual rig name in lifecycle messages (gt-6vks)
The getManager() function was returning a literal "<rig>/witness" string
for polecats and refineries instead of substituting the actual rig name.

This caused LIFECYCLE messages to be sent to "@<rig>/witness" instead of
proper addresses like "@gastown/witness".

Fix:
- Add detectRigFromContext() to extract rig from current directory
- Update getManager() to use detected rig name
- Fallback to deacon/ if rig detection fails (safety)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:23:17 -08:00
Steve Yegge
d2fccd580c feat(daemon): Add slot-based notification deduplication (gt-wpg)
Implement replaceable notifications to prevent heartbeat stacking when
agents are busy. Only the latest notification per slot is delivered.

Changes:
- Add NotificationManager for tracking pending notifications
- Add SendKeysReplace() that clears input line before sending
- Integrate slot tracking into daemon heartbeat pokes
- Mark notifications consumed when agent shows activity

The system tracks pending notifications in state files and skips
sending if a notification for the same slot is still pending.
When agent activity is detected (keepalive), slots are marked
consumed allowing new notifications to be sent.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:19:40 -08:00
Steve Yegge
9509afa6b1 feat(nudge): Add gt nudge command for reliable Claude session messaging
Encapsulates tmux send-keys with: literal mode, 500ms debounce, separate Enter.
Tested and reliable. Updates spawn.go to use NudgeSession.

Related: gt-1hf, gt-lz2

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 13:19:39 -08:00
Steve Yegge
cc0ee19a8b spawn: add direct nudge after session start
Instead of relying solely on hooks or witness coordination, spawn now:
- Waits 3 seconds for Claude Code to fully initialize
- Sends a direct nudge to the polecat to check inbox
- Still notifies Witness as backup monitoring

This provides immediate feedback to polecats without waiting for
witness response.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 09:23:57 -08:00
Steve Yegge
a32c711e97 spawn: use town-level beads for Witness notification
The SPAWN notification to Witness was going to rig-level beads,
but gt mail inbox checks town-level first. This caused messages
to get lost.

Fixes part of gt-c6b.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 09:23:57 -08:00
Steve Yegge
cfb33241dd spawn: Use detectSender() for From field, document Deacon fallback 2025-12-20 09:23:57 -08:00
Steve Yegge
c81ea13baa spawn: Notify Witness instead of direct nudge
- Remove hacky 5-second delay from spawn
- Send SPAWN notification to Witness after starting polecat session
- Witness uses AI to monitor polecat startup and nudge when ready
- Added SPAWN REQUEST PROCESSING section to Witness template

This implements event-driven polecat readiness detection (gt-hb0).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 09:23:57 -08:00
Steve Yegge
363a2c45ba fix(statusline): Count rigs from all agent types, not just polecats
- Rig count now includes rigs with any active sessions (witness, refinery, crew)
- Previously only counted rigs that had active polecat sessions
- Updated tests to use categorizeSession instead of removed helper functions

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 09:23:57 -08:00
Steve Yegge
2b32c27f29 spawn: Add work instruction + export SessionName
- Export session.Manager.SessionName for spawn.go access
- Add --address alias for --identity in mail inbox/check
- Send explicit work instruction to polecat after spawn
- Add CapturePaneLines and WaitForClaudeReady helpers (unused for now)
- Proper solution filed as gt-hb0 (needs Witness/Deacon AI monitoring)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 09:23:57 -08:00
Steve Yegge
c84d832c98 docs: Add pluggable molecules design documentation
- Add Pluggable Molecules section to architecture.md explaining
  directory-based plugins for extensible workflows
- Create molecules.md with full design for code-review molecule
- Document plugin CLAUDE.md format with frontmatter
- Describe phased execution (discovery/structural/tactical/synthesis)
- Include implementation plan and usage examples

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 09:23:57 -08:00
Steve Yegge
17123eabd9 fix(spawn): use rig-level beads instead of mayor/rig path
The spawn command and polecat manager were incorrectly looking for beads
in <rig>/mayor/rig/.beads instead of <rig>/.beads. This caused:
- `gt spawn --issue ga-xxp` to fail with "no issue found" even when
  `bd show ga-xxp` worked from the rig directory
- Polecats couldn't find rig-level issues (with ga- prefix) because
  mayor/rig has a different beads database (with gt- prefix)

This fix:
- spawn.go: Use r.Path instead of filepath.Join(r.Path, "mayor", "rig")
- polecat/manager.go: Use r.Path for beads.New() initialization
- session/manager.go: Use r.Path/.beads for BEADS_DIR environment

Closes beads-2nh

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 09:23:57 -08:00
Steve Yegge
189d583518 spawn: add direct nudge after session start
Instead of relying solely on hooks or witness coordination, spawn now:
- Waits 3 seconds for Claude Code to fully initialize
- Sends a direct nudge to the polecat to check inbox
- Still notifies Witness as backup monitoring

This provides immediate feedback to polecats without waiting for
witness response.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 09:19:10 -08:00
Steve Yegge
2688a3fe9a spawn: use town-level beads for Witness notification
The SPAWN notification to Witness was going to rig-level beads,
but gt mail inbox checks town-level first. This caused messages
to get lost.

Fixes part of gt-c6b.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 08:56:13 -08:00
Steve Yegge
4bf74f7a95 spawn: Use detectSender() for From field, document Deacon fallback 2025-12-20 08:44:17 -08:00
Steve Yegge
90e0fab85c spawn: Notify Witness instead of direct nudge
- Remove hacky 5-second delay from spawn
- Send SPAWN notification to Witness after starting polecat session
- Witness uses AI to monitor polecat startup and nudge when ready
- Added SPAWN REQUEST PROCESSING section to Witness template

This implements event-driven polecat readiness detection (gt-hb0).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 08:38:05 -08:00
Steve Yegge
4782269267 fix(statusline): Count rigs from all agent types, not just polecats
- Rig count now includes rigs with any active sessions (witness, refinery, crew)
- Previously only counted rigs that had active polecat sessions
- Updated tests to use categorizeSession instead of removed helper functions

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 08:21:39 -08:00
Steve Yegge
478623f8bd Merge main with statusline fixes 2025-12-20 08:19:00 -08:00
Steve Yegge
d0259af61e spawn: Add work instruction + export SessionName
- Export session.Manager.SessionName for spawn.go access
- Add --address alias for --identity in mail inbox/check
- Send explicit work instruction to polecat after spawn
- Add CapturePaneLines and WaitForClaudeReady helpers (unused for now)
- Proper solution filed as gt-hb0 (needs Witness/Deacon AI monitoring)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 08:15:23 -08:00
Steve Yegge
c2458365e6 Merge polecat/slit: fix rig count in status bar (resolved conflicts) 2025-12-20 08:03:29 -08:00
Steve Yegge
a43d0eb711 Merge polecat/rictus: fix mail priority flag (gt-kspu) 2025-12-20 08:02:18 -08:00
Steve Yegge
6a19cd8c36 fix(statusline): Correct rig count and polecat count in tmux status bar
The status bar was incorrectly counting rigs and polecats due to:

1. Inconsistent witness session naming (gt-<rig>-witness vs gt-witness-<rig>)
   caused "witness" to be counted as a rig name
2. Non-polecat sessions (witness, refinery, crew) were counted as polecats

Added extractRigFromSession() to handle all session naming patterns and
isPolecatSession() to properly identify actual polecat workers.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 07:59:44 -08:00
Steve Yegge
bae097cb35 fix(mail): Align gt mail send --priority with bd mail send (gt-kspu)
Changed --priority flag from string values (low/normal/high/urgent) to
numeric values (0-4) to match bd mail send interface:
- 0 = urgent/critical
- 1 = high
- 2 = normal (default)
- 3 = low
- 4 = backlog

Also added --urgent flag as shortcut for --priority 0.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 07:59:02 -08:00
Steve Yegge
94c25a2981 fix(statusline): count only polecats in mayor status bar
The mayor tmux status line was counting all gt-* sessions as polecats,
including witnesses, refineries, deacon, and crew workers. Now uses
categorizeSession() to properly identify only actual polecats.

Also removes dead code handling gt-witness-<rig> pattern (only
gt-<rig>-witness is valid).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 07:55:54 -08:00
Steve Yegge
5e36cf09dd Merge polecat/nux: fix witness role template mail command 2025-12-20 03:57:05 -08:00
Steve Yegge
1b851311c2 fix(witness): Correct mail command in witness role template
Replace non-existent `gt mail ack` with `gt mail delete` in the witness
role template. The `ack` subcommand exists in `bd mail` but not in
`gt mail` - the correct command is `gt mail delete` which acknowledges
and closes messages.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 03:54:25 -08:00
Steve Yegge
cf756f06d3 docs: Add pluggable molecules design documentation
- Add Pluggable Molecules section to architecture.md explaining
  directory-based plugins for extensible workflows
- Create molecules.md with full design for code-review molecule
- Document plugin CLAUDE.md format with frontmatter
- Describe phased execution (discovery/structural/tactical/synthesis)
- Include implementation plan and usage examples

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 03:09:20 -08:00
Steve Yegge
da12531d3d feat: add gt up/down commands and daemon doctor check
New commands:
- `gt up` - Idempotent boot command that brings up all services:
  Daemon, Deacon, Mayor, and Witnesses for all rigs
- `gt down` - Graceful shutdown of all services

Doctor improvements:
- New daemon check verifies daemon is running
- Fixable with `gt doctor --fix` to auto-start daemon

The system can run degraded (any services down) but `gt up` ensures
a fully operational Gas Town with one idempotent command.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 02:26:09 -08:00
Steve Yegge
1554380228 feat(deacon): improve timing and add heartbeat command
Timing changes for more relaxed poke intervals:
- Daemon heartbeat: 60s → 5 minutes
- Backoff base: 60s → 5 minutes
- Backoff max: 10m → 30 minutes
- Fresh threshold: <2min → <5min
- Stale threshold: 2-5min → 5-15min
- Very stale threshold: >5min → >15min

New command:
- `gt deacon heartbeat [action]` - Touch heartbeat file easily

Template rewrite:
- Clearer wake/sleep model
- Documents wake sources (daemon poke, mail, timer callbacks)
- Simpler rounds with `gt deacon heartbeat` instead of bash echo
- Mentions plugins as optional maintenance tasks
- Explains timer callbacks pattern

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 02:12:21 -08:00
Steve Yegge
348a7d0525 feat(deacon): make deacon the system heartbeat with auto-start
Robustness improvements for the Deacon:

- Add DeaconTheme (purple/silver ecclesiastical theme)
- Apply theme to deacon sessions like mayor/witness
- Daemon now auto-starts deacon if not running
- Daemon pokes deacon instead of directly poking mayor/witnesses
- Deacon is responsible for monitoring mayor and witnesses

The daemon is a "dumb scheduler" that keeps the deacon alive.
The deacon (Claude agent) has the intelligence to understand
context and take remedial action when agents are unhealthy.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 02:00:54 -08:00
Steve Yegge
a37fac2c3c docs(refinery): Add sequential rebase protocol to template
Adds documentation for the critical pileup processing protocol:
- Process ONE branch at a time
- Rebase each on current main before merging
- Push immediately after each merge
- Main moves forward, next branch must rebase on NEW main

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 01:57:47 -08:00
Steve Yegge
a000b40ed4 fix: crew workers now get proper crew context via templates
Updated crew manager's createClaudeMD() to use the templates package
instead of hardcoded content. This ensures crew workers get the
comprehensive crew.md.tmpl context instead of a minimal stub.

Changes:
- Import templates package in crew/manager.go
- createClaudeMD now renders crew template with proper RoleData
- Added createClaudeMDFallback for graceful degradation
- Fallback uses correct gt commands instead of outdated town commands

The crew.md.tmpl template provides:
- Full Gas Town architecture explanation
- Crew-specific responsibilities and differences from polecats
- Complete command reference with gt/bd commands
- Session cycling and handoff instructions
- Context-aware workspace paths

Closes: gt-unrd

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 01:51:26 -08:00
Steve Yegge
d154533d49 feat(refinery): Convert Refinery from Go polling to Claude agent
The Refinery now runs as a Claude agent in a tmux session instead of
a Go-based polling loop. This aligns it with how polecats work and
enables intelligent MR processing.

Changes:
- Modified refinery.Start() to spawn Claude session (not gt refinery --foreground)
- Added gt refinery attach command for interactive access to refinery session
- Updated refinery.md.tmpl with comprehensive Claude agent instructions
- Added startup directive in gt prime for refinery role

The --foreground mode is preserved for backwards compatibility but the
default behavior now launches a Claude agent that can review diffs,
run tests, handle conflicts, and notify workers via mail.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 01:45:20 -08:00
Steve Yegge
1a25259932 feat(cmd): add gt agents command for session switching
Adds a popup menu showing core Gas Town agents (Mayor, Deacon,
Witnesses, Refineries, Crew) grouped by rig with color coding.
Polecats are hidden by default (use -a to include).

Usage:
  gt agents      - show popup menu
  gt agents list - text output
  gt ag -a       - include polecats

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 01:21:31 -08:00
Steve Yegge
b9c99e854a Consolidate @AGENTS.md into CLAUDE.md pattern
- Replace @AGENTS.md with stub AGENTS.md
- Stub redirects to CLAUDE.md for full context

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 00:40:40 -08:00
Steve Yegge
f43c01de4e docs: update public positioning for Gas Town
- Rewrite vision.md with enterprise cognitive processing framing
- Expand README with comprehensive project overview
- Remove internal strategic references from merge-queue-design.md
- Position Gas Town as "IDE of 2026" for AI agent orchestration

Key messaging:
- Enterprise-grade cognitive processing machine
- Molecules as structured workflow guardrails
- Nondeterministic idempotence for crash recovery
- Beads as unified control/data plane
- Hierarchical auditability and observability

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 00:21:18 -08:00
Steve Yegge
43641e1dfb fix(spawn): use rig-level beads instead of mayor/rig path
The spawn command and polecat manager were incorrectly looking for beads
in <rig>/mayor/rig/.beads instead of <rig>/.beads. This caused:
- `gt spawn --issue ga-xxp` to fail with "no issue found" even when
  `bd show ga-xxp` worked from the rig directory
- Polecats couldn't find rig-level issues (with ga- prefix) because
  mayor/rig has a different beads database (with gt- prefix)

This fix:
- spawn.go: Use r.Path instead of filepath.Join(r.Path, "mayor", "rig")
- polecat/manager.go: Use r.Path for beads.New() initialization
- session/manager.go: Use r.Path/.beads for BEADS_DIR environment

Closes beads-2nh

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 23:28:06 -08:00
Steve Yegge
bc8a33a028 feat(witness): Implement Witness as Claude agent (gt-xicq)
Convert the Witness from a Go polling loop to a Claude agent with:

- Enhanced witness.md.tmpl with detailed agent instructions:
  - Startup protocol for checking handoffs and polecat status
  - Lifecycle request processing (verify git state, cleanup)
  - Health check protocol for detecting stuck polecats
  - Nudge protocol with 3-strike escalation
  - Escalation protocol for unresolvable issues
  - Session cycling with handoff mail

- Updated gt witness attach to:
  - Create sessions in <rig>/witness/ directory for proper role detection
  - Ensure witness directory exists

- Added startup directive for Witness role in gt prime

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 23:24:51 -08:00
Steve Yegge
9b711b3997 feat(refinery): Convert Refinery from Go polling to Claude agent
The Refinery now runs as a Claude agent in a tmux session instead of
a Go-based polling loop. This aligns it with how polecats work and
enables intelligent MR processing.

Changes:
- Modified refinery.Start() to spawn Claude session (not gt refinery --foreground)
- Added gt refinery attach command for interactive access to refinery session
- Updated refinery.md.tmpl with comprehensive Claude agent instructions
- Added startup directive in gt prime for refinery role

The --foreground mode is preserved for backwards compatibility but the
default behavior now launches a Claude agent that can review diffs,
run tests, handle conflicts, and notify workers via mail.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 23:23:34 -08:00
Steve Yegge
481138a72b feat(polecat): Add gt polecat status command (gt-6lt3)
Implements detailed polecat status display including:
- Lifecycle state (working, done, stuck, idle)
- Assigned issue
- Session status (running/stopped, attached/detached)
- Session creation time
- Last activity time with relative "ago" format

Also extends tmux.SessionInfo and session.Info to include
last activity timestamp from tmux session_activity.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 23:23:15 -08:00
Steve Yegge
71d313ed60 Fix mail read auto-ack and add Mayor startup directive
- Remove auto-ack on mail read so handoff messages persist
- Add STARTUP PROTOCOL directive for Mayor and Polecat roles
- Agents now get explicit instructions to check in on startup

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 22:38:10 -08:00
Steve Yegge
7978b395cd Merge remote-tracking branch 'origin/polecat/polecat-02' 2025-12-19 22:18:06 -08:00