Commit Graph

1709 Commits

Author SHA1 Message Date
Steve Yegge
196c3bbf9b Fix gt sling --naked to bypass pane lookup for terminated polecats
When slinging to an existing polecat with --naked flag, the code was still
attempting to look up the tmux pane, which fails for terminated polecats.
Now resolveTargetAgent accepts a skipPane parameter that bypasses the tmux
pane and working directory lookup when true.

This allows work to be slung to terminated polecats that will be restarted
manually later.

Also updated unsling to skip pane lookup since it only needs the agent ID.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:08:31 -08:00
Steve Yegge
3f09801939 Add CLAUDE.md to .gitignore (gt-yskrz)
CLAUDE.md is clone-specific (contains crew member name and working
directory) and should not be tracked in git.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:07:53 -08:00
Steve Yegge
dbf2f0f173 Make CLAUDE.md clone-specific (gitignored) (gt-yskrz)
CLAUDE.md contains clone-specific content (crew member name, working
directory) and should not be tracked in git. Each clone regenerates
its CLAUDE.md locally when created via `gt crew add`.

This prevents crew workers from getting incorrect identity context
when pulling changes made by other crew members.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:06:42 -08:00
Steve Yegge
8b26ac9346 Fix crew CLAUDE.md with correct crew template (gt-yskrz)
The crew CLAUDE.md files were incorrectly using polecat template
content. This regenerates them with the proper crew template.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:05:13 -08:00
Steve Yegge
99bc3d3bf8 Fix naked mode help text to include --dangerously-skip-permissions (gt-8f0zv)
The main polecat spawn fix was already in place (ec29ca07), but the naked
mode help text was telling users to run `claude` without the flag. Updated
to show the correct command with --dangerously-skip-permissions.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:04:01 -08:00
Steve Yegge
846200e989 Close gt-vdprb.1: await-signal implementation complete 2025-12-29 22:02:50 -08:00
Steve Yegge
8a46d80fb8 Add await-signal command for patrol agent feed subscription (gt-vdprb.1)
Implements the primary wake mechanism for patrol agents:
- Subscribes to bd activity --follow as a background process
- Returns immediately when any line of output is received
- Timeout with optional exponential backoff as safety net
- JSON output mode for scripting

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:02:45 -08:00
Steve Yegge
4cc09dbe82 Update polecat context and sync beads (gt-l90dq)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:01:59 -08:00
Steve Yegge
6da21f6a3e Fix gt crew at to detect existing Claude sessions (gt-l90dq)
Before: gt crew at only looked for tmux sessions with the specific naming
convention gt-<rig>-crew-<name>. If the user started Claude manually or
via a different mechanism, it would create a duplicate session.

After: Before creating a new session, check if any existing tmux session
has Claude running in the crews directory. If found, attach to that
session instead of creating a new one.

Changes:
- Add FindSessionByWorkDir() to internal/tmux/tmux.go to search sessions
  by working directory, optionally filtering for Claude (node) running
- Update runCrewAt() to check for existing sessions before creating new

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:01:59 -08:00
Steve Yegge
81b250ee32 Fix --issue flag in gt session start to hook work to polecat (gt-pxsna)
When starting a polecat session with --issue flag, the issue is now
properly hooked to the polecat via bd update --status=hooked. This
ensures 'gt mol status' shows the assigned work when the session starts.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:00:07 -08:00
Steve Yegge
1dbb9555e2 Sync beads from main 2025-12-29 21:58:13 -08:00
Steve Yegge
10e797895a Fix swarm not tracking dynamically added workers (gt-qd9p0)
Two bugs fixed in loadTasksFromBeads():
1. JSON field name mismatch: code parsed dependencies but bd show
   returns dependents - meant worker discovery always failed
2. Missing Assignee field: even if field name was correct, assignees
   were not being extracted from the bd show output

Also added hooked status to TaskInProgress mapping since workers
with hooked beads are actively working.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 21:58:06 -08:00
Steve Yegge
ba720fb82a Revert "feat: add gt commit command with agent identity trailers (bd-luso)"
This reverts commit 4b75b15d53.
2025-12-29 21:13:04 -08:00
Steve Yegge
4b75b15d53 feat: add gt commit command with agent identity trailers (bd-luso)
Adds a new 'gt commit' command that wraps git commit and automatically
injects agent identity trailers into commit messages:

- Executed-By: agent identity (e.g., beads/crew/dave)
- Rig: the rig name
- Role: crew, polecat, witness, etc.
- Molecule: pinned molecule ID if any

This enables forensic analysis and audit trails for agent-mediated commits.

Supports common git commit flags: -a, --amend, --no-edit, --allow-empty.
Use --no-trailers to skip adding identity trailers.
2025-12-29 21:08:49 -08:00
Steve Yegge
a087f7d8fc bd sync: 2025-12-29 21:00:01 2025-12-29 21:00:01 -08:00
Steve Yegge
a375e79018 bd sync: 2025-12-29 20:51:06 2025-12-29 20:51:06 -08:00
Steve Yegge
32a623f801 fix: Tighten overseer validation, document fallback behavior 2025-12-29 18:31:58 -08:00
Steve Yegge
d3a27b2650 Rewrite swarm tests to use beads-backed API (gt-kc7yj.4)
- Add LoadSwarm method for loading swarms from beads
- Rewrite tests to use LoadSwarm, GetSwarm, GetReadyTasks, IsComplete
- Remove tests for deprecated Create, Start, UpdateState methods
- Keep E2E lifecycle documentation test

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 18:26:23 -08:00
Steve Yegge
da4829fb07 Add E2E swarm integration test documentation (gt-kc7yj.4)
Document the complete swarm lifecycle test protocol in manager_test.go:
- Epic creation with diamond-shaped DAG (A→B,C→D)
- bd swarm validate wave analysis
- bd swarm create molecule creation
- Ready front tracking and advancement
- Issue completion unblocks dependents
- Swarm auto-close behavior (requires Witness)

Filed gt-594a4 for gt swarm status/land routing issue.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 18:24:59 -08:00
Steve Yegge
553e29626a Daemon heartbeat becomes recovery-focused (gt-vdprb.4)
Change daemon from wake-focused to recovery-focused:

Before: Daemon pokes agents every 5-60min as primary wake
After: Daemon only checks for edge cases that feed-wake cannot handle

Recovery checks:
- Dead sessions that need restart (ensureDeaconRunning, ensureWitnessesRunning)
- Stale agents that crashed without updating state (checkStaleAgents)
- GUPP violations: agents with work-on-hook not progressing (checkGUPPViolations)
- Orphaned work: work assigned to dead agents (checkOrphanedWork)

Removed:
- pokeDeacon() - no longer sending HEARTBEAT messages
- pokeWitness()/pokeWitnesses() - no longer sending HEARTBEAT messages
- MOTD message arrays - only used by poke functions

Normal agent wake is now handled by feed subscription (bd activity --follow).
The daemon is the safety net for edge cases, not the primary propulsion.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 18:10:20 -08:00
Steve Yegge
1889e2b164 Update CLAUDE.md for polecat furiosa (gt-l6ro3.3)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 18:07:39 -08:00
Steve Yegge
0085353056 Add await-signal molecule step type with backoff support (gt-l6ro3.3)
Adds Type and Backoff fields to MoleculeStep for patrol agents to implement
cost-saving await-signal patterns:

- Type field: "task" (default), "wait" (await-signal), etc.
- BackoffConfig: base interval, multiplier, max cap
- Parsing for "Type:" and "Backoff:" lines in step definitions
- Comprehensive tests for new parsing functionality

Step definition format:
  ## Step: await-signal
  Type: wait
  Backoff: base=30s, multiplier=2, max=10m

Agents interpret these declaratively, implementing backoff behavior at runtime.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 18:07:39 -08:00
Steve Yegge
03775c6fc7 Startup hooks nudge Deacon for GUPP backstop (gt-vdprb.3)
- Add special handling for 'deacon' target in gt nudge command
- Maps 'deacon' to gt-deacon session, gracefully handles if not running
- Add gt nudge deacon session-started to SessionStart hooks
- Updated settings-autonomous.json, settings-interactive.json, and
  ensurePatrolHooks() template

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 18:05:50 -08:00
Steve Yegge
73f829bebd bd sync: 2025-12-29 18:04:39 2025-12-29 18:04:39 -08:00
Steve Yegge
a09027043d feat: Add overseer identity for human operator mail support
Adds first-class support for the human overseer in Gas Town mail:

- New OverseerConfig in internal/config/overseer.go with identity
  detection (git config, gh cli, environment)
- Overseer detected/saved on town install (mayor/overseer.json)
- Simplified detectSender(): GT_ROLE set = agent, else = overseer
- New overseer address alongside mayor/ and deacon/
- Added --cc flag to mail send for CC recipients
- Inbox now includes CC'd messages via label query
- gt status shows overseer identity and unread mail count
- New gt whoami command shows current mail identity

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 18:02:49 -08:00
Steve Yegge
cab9e10d30 bd sync: 2025-12-29 17:56:05 2025-12-29 17:56:05 -08:00
Steve Yegge
4719ecc1fd bd sync: 2025-12-29 17:55:17 2025-12-29 17:55:17 -08:00
Steve Yegge
2276edd917 beads sync 2025-12-29 17:12:57 -08:00
Steve Yegge
6e43b00be1 bd sync: 2025-12-29 17:12:43 2025-12-29 17:12:57 -08:00
Steve Yegge
f7393b6cdb refactor: Remove in-memory swarms map, make Manager stateless
The swarm Manager was maintaining an in-memory map of swarms that was
never persisted and duplicated state from beads. This caused stale state
after restarts and confusion about source of truth.

Changes:
- Remove swarms map from Manager (now stateless)
- Add LoadSwarm() that queries beads for swarm state
- Refactor all methods to use LoadSwarm() instead of in-memory lookup
- Discover workers from assigned tasks in beads
- Remove obsolete unit tests that tested in-memory behavior
- Keep type/state tests that do not need beads

The E2E test (gt-kc7yj.4) now covers the beads integration.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 17:12:30 -08:00
Steve Yegge
5fa1772cb0 bd sync: 2025-12-29 16:12:01 2025-12-29 16:12:01 -08:00
Steve Yegge
8489dec42b bd sync: 2025-12-29 16:11:24 2025-12-29 16:11:50 -08:00
Steve Yegge
67d85dafdb fix: Change 'Pinned' to 'Hooked' in gt mol status output (gt-d9smb)
- Changed icon from 📌 to 🪝 for hooked beads
- Changed label from "Pinned" to "Hooked"
- Added 🚀 AUTONOMOUS MODE banner when work is on hook
- Clarified that hooked bead triggers autonomous work even without molecule

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 16:11:13 -08:00
Steve Yegge
3ef4949afb bd sync: 2025-12-29 16:08:22 2025-12-29 16:08:22 -08:00
Steve Yegge
d8a410ca3c feat: Add capability ledger framing and fix hooked/pinned terminology (gt-3amkz)
Add "The Capability Ledger" section to all 6 role templates explaining:
- Work visibility and reputation
- Redemption through consistent quality
- Every completion as evidence of autonomous execution at scale
- Work history as growing portfolio/CV

Also fix hooked vs pinned terminology confusion:
- "Hooked" = work assigned to you (triggers autonomous mode)
- "Pinned" = permanent reference beads
- Add clarifying note to all startup behavior sections
- Update code examples to use --status=hooked

Update prime.go AUTONOMOUS MODE output with ledger framing.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 16:06:47 -08:00
Steve Yegge
47c980fefd bd sync: 2025-12-29 15:40:57 2025-12-29 15:40:57 -08:00
Steve Yegge
c31bff4e6d bd sync: 2025-12-29 15:30:17 2025-12-29 15:30:17 -08:00
Steve Yegge
98d46bf7f6 bd sync: 2025-12-29 15:29:43 2025-12-29 15:30:05 -08:00
Steve Yegge
a9637c661f bd sync: 2025-12-29 15:29:28 2025-12-29 15:30:05 -08:00
Steve Yegge
8680edf18d bd sync: 2025-12-29 15:29:07 2025-12-29 15:30:05 -08:00
Steve Yegge
4cdd3e30e2 bd sync: 2025-12-29 15:25:03 2025-12-29 15:30:05 -08:00
Steve Yegge
87bc02b009 fix: Use rig's configured prefix for agent bead IDs (gt-kdy77, gt-ihvq0)
Added WithPrefix variants to agent bead ID functions:
- AgentBeadIDWithPrefix(prefix, rig, role, name)
- WitnessBeadIDWithPrefix, RefineryBeadIDWithPrefix
- CrewBeadIDWithPrefix, PolecatBeadIDWithPrefix

Updated callers to use rig's configured prefix:
- crew_add.go: reads r.Config.Prefix for crew worker beads
- rig/manager.go: uses prefix param for witness/refinery beads
- doctor/agent_beads_check.go: uses prefix from routes.jsonl

This allows non-gastown rigs (like beads with bd- prefix) to have
properly-prefixed agent beads.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 15:29:16 -08:00
Steve Yegge
5260a9ca08 fix: Close agent bead when crew workspace is removed (gt-rqcd8)
When gt crew remove runs, it now closes the associated agent bead
(gt-<rig>-crew-<name>) with reason "Crew workspace removed".

This prevents orphaned agent beads in the system after crew removal.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 15:24:45 -08:00
Steve Yegge
1c6d7d929b feat: Auto-close swarm epic when all children complete
Update mol-witness-patrol formula to:
1. Close the epic (swarm molecule) when all children are closed
2. Close the swarm tracking wisp
3. Notify Mayor with SWARM_COMPLETE mail

Activity feed events are generated automatically by bd close commands.

(gt-kc7yj.3)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 15:20:40 -08:00
Steve Yegge
93a5211fb2 fix: Use StatusHooked for AUTONOMOUS MODE, add propulsion to refinery template
- checkSlungWork now queries for status=hooked instead of status=pinned
- This makes AUTONOMOUS WORK MODE fire correctly when work is slung via gt hook
- Added "physics not politeness" language to AUTONOMOUS MODE output
- Added full Theory of Operation section to refinery.md.tmpl for consistency

The bug was: gt hook sets status=hooked but gt prime was querying for
status=pinned, so AUTONOMOUS MODE never triggered for hooked work.

(gt-kc7yj.3)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 15:17:14 -08:00
Steve Yegge
9122c35a73 bd sync: 2025-12-29 15:06:22 2025-12-29 15:06:22 -08:00
Steve Yegge
b7a7600bca bd sync: 2025-12-29 14:56:45 2025-12-29 14:56:45 -08:00
Steve Yegge
fed3844ccb bd sync: 2025-12-29 14:56:26 2025-12-29 14:56:26 -08:00
Steve Yegge
bdd03c51dc bd sync: 2025-12-29 14:55:19 2025-12-29 14:55:51 -08:00
Steve Yegge
354f7e7277 bd sync: 2025-12-29 14:54:04 2025-12-29 14:55:51 -08:00