Commit Graph

1729 Commits

Author SHA1 Message Date
Steve Yegge
5d3f500614 bd sync: 2025-12-29 23:34:50 2025-12-29 23:34:50 -08:00
Steve Yegge
17f993a041 bd sync: close gt-xd95b 2025-12-29 23:32:14 -08:00
Steve Yegge
0945428761 bd sync: 2025-12-29 23:32:02 2025-12-29 23:32:02 -08:00
Steve Yegge
91236ea268 feat: Add polecat workflow quality levels (basic/shiny/chrome)
Three pre-baked polecat workflows with increasing rigor:
- mol-polecat-basic: 3 steps, for trivial P4 fixes
- mol-polecat-shiny: 6 steps, standard quality with design/review
- mol-polecat-chrome: 16 steps, max rigor with strategic context reading,
  triple code review, and decomposed implementation phases

Added --quality (-q) flag to gt sling as shorthand:
  gt sling gt-abc gastown -q basic   # quick fix
  gt sling gt-abc gastown -q shiny   # standard
  gt sling gt-abc gastown -q chrome  # max rigor

Chrome explicitly requires reading ~/gt/docs/hop/CONTEXT.md and
~/gt/docs/PRIMING.md before design begins.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:19:32 -08:00
Steve Yegge
f99b98d94c bd sync: 2025-12-29 23:18:03 2025-12-29 23:18:03 -08:00
Steve Yegge
baa2ac08d4 bd sync: 2025-12-29 23:17:54 2025-12-29 23:17:54 -08:00
Steve Yegge
de7ad160e2 bd sync: 2025-12-29 23:17:36 2025-12-29 23:17:45 -08:00
Steve Yegge
9b59b8cc6b bd sync: 2025-12-29 23:17:08 2025-12-29 23:17:45 -08:00
Steve Yegge
540e51dc0f feat: add mol-polecat-chrome formula with parameterized context_docs (gt-c0fzm)
Adds a new workflow formula for polecat work that includes strategic
context reading before design. The context_docs variable allows
customization of which organizational documents to read.

Default: ~/gt/docs/hop/CONTEXT.md,~/gt/docs/PRIMING.md (Gas Town docs)
Override: gt sling formula --var context_docs="docs/ARCH.md,docs/STYLE.md"

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:17:29 -08:00
Steve Yegge
c6a48d34a5 bd sync: close code review gt-ddugk
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:48:17 -08:00
Steve Yegge
e2e25930c3 feat: Implement formula-on-bead mode in gt sling
When using `gt sling <formula> --on <bead>`, the command now properly
instantiates the formula as a molecule and bonds it to the target bead:

1. Cook the formula (ensures proto exists)
2. Create wisp with feature variable from bead title
3. Bond wisp to original bead (creates compound)
4. Hook the compound root (not bare bead) to target agent

This enables the "shiny" workflow (design→implement→review→test→submit)
to be applied to existing bugs/features, ensuring polecats complete all
phases including the code review step.

Example:
  gt sling shiny --on gt-abc gastown
  # Creates shiny molecule, bonds to gt-abc, slings compound to polecat

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:46:18 -08:00
Steve Yegge
a8401863a7 bd sync: 2025-12-29 22:28:41 2025-12-29 22:28:42 -08:00
Steve Yegge
3ce686f2ba bd sync: 2025-12-29 22:28:17 2025-12-29 22:28:20 -08:00
Steve Yegge
95831646ba Close merge request gt-powfg (already merged)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:14:24 -08:00
Steve Yegge
85ec39c487 fix: Add session health monitoring and auto-restart for crashed polecats (gt-i7wcn)
This fix addresses the issue where polecat sessions terminate unexpectedly
during work without recovery:

Changes:
- Add `checkPolecatSessionHealth()` to daemon heartbeat loop
  - Proactively validates tmux sessions are alive for polecats
  - Detects crashed polecats that have work-on-hook
  - Auto-restarts crashed polecats with proper environment setup
  - Notifies Witness if restart fails as fallback

- Add polecat support to lifecycle identity mapping
  - `identityToSession()` now handles polecat identities
  - `restartSession()` can restart crashed polecat sessions
  - `identityToStateFile()` handles polecat state files
  - `identityToAgentBeadID()` handles polecat agent beads
  - `identityToBDActor()` handles polecat BD_ACTOR conversion

- Add `gt session check` command for manual health checking
  - Validates tmux sessions exist for all polecats
  - Shows summary of healthy vs not-running sessions
  - Useful for debugging session issues

This provides faster recovery (within heartbeat interval) compared to
waiting for GUPP violation timeout (30 min) or Witness detection.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:13:24 -08:00
Steve Yegge
3d2918443e bd sync: 2025-12-29 22:13:09 2025-12-29 22:13:09 -08:00
Steve Yegge
f67b6b8446 bd sync: 2025-12-29 22:09:17 2025-12-29 22:09:17 -08:00
Steve Yegge
e4fbbdce3b bd sync: 2025-12-29 22:09:05 2025-12-29 22:09:07 -08:00
Steve Yegge
f1168954fc bd sync: 2025-12-29 22:08:49 2025-12-29 22:09:07 -08:00
Steve Yegge
9e05faf8ac bd sync: 2025-12-29 22:08:38 2025-12-29 22:09:07 -08:00
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