Commit Graph

1751 Commits

Author SHA1 Message Date
Steve Yegge
ff98567569 bd sync: 2025-12-29 23:57:11 2025-12-29 23:57:14 -08:00
Steve Yegge
5626682b80 bd sync: 2025-12-29 23:49:17 2025-12-29 23:57:14 -08:00
Steve Yegge
c30884b36c bd sync: 2025-12-29 23:48:01 2025-12-29 23:57:14 -08:00
Steve Yegge
cd1d947a76 bd sync: 2025-12-29 23:47:49 2025-12-29 23:57:14 -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
65d4dbe222 Refinery emits activity events for MQ lifecycle (gt-ytsxp)
Add merge queue activity events to the refinery:
- merge_started: When refinery begins processing an MR
- merged: When MR successfully merged to main
- merge_failed: When merge fails (conflict, tests, push, etc.)
- merge_skipped: When MR skipped (superseded)

Events include MR ID, worker, branch, and reason (for failures).
Implemented in both Manager.ProcessMR and Engineer.ProcessMRFromQueue.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:48:25 -08:00
Steve Yegge
e362be3c41 fix: Use BeadsPath() for swarm status to read from git-synced beads (gt-1rxz5)
The swarm status was stale because bd commands were running from the rig
root path instead of the mayor/rig clone which has proper beads sync config.

Changes:
- Add Rig.BeadsPath() method to return mayor/rig path when available
- Update all bd commands in swarm.go to use BeadsPath()
- Update swarm manager to use separate beadsDir and gitDir paths
- beadsDir for bd commands (git-synced location)
- gitDir for git operations and mail (rig root)

This ensures swarm status reflects the latest beads data from the
git-synced beads-sync branch instead of stale local daemon data.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:46:59 -08:00
Steve Yegge
deb58838ad fix: Use SQLite columns for hook_bead instead of description text (gt-9v52)
Previously, UpdateAgentState embedded hook_bead in the description
text field, while bd slot commands read/write from the SQLite
hook_bead column. This caused gt sling to report hooks as occupied
when bd slot show showed them empty.

Fix: Change UpdateAgentState to use proper bd commands:
- `bd agent state` for agent_state (updates column directly)
- `bd slot set/clear` for hook_bead (updates column directly)

This ensures consistency between gastown and beads commands.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:46:10 -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
070a8be738 bd sync: 2025-12-29 23:45:09 2025-12-29 23:45:09 -08:00
Steve Yegge
a582114415 bd sync: 2025-12-29 23:44:23 2025-12-29 23:44:23 -08:00
Steve Yegge
73112e29e4 bd sync: 2025-12-29 23:47 2025-12-29 23:44:00 -08:00
Steve Yegge
411d35a53a bd sync: 2025-12-29 23:43:52 2025-12-29 23:44:00 -08:00
Steve Yegge
9febd4e7dc bd sync: 2025-12-29 23:43:39 2025-12-29 23:44:00 -08:00
Steve Yegge
f9e820985d feat: Filter agent session molecule noise from activity feed
Agent session molecules (gt-gastown-crew-joe, gt-gastown-witness, etc.)
update frequently for status tracking, creating noisy entries in the
activity feed. This change:

- Adds IsAgentSessionBead() to identify agent session beads
- Filters out "update" events for agent sessions from the event feed
- Still updates the agent tree so status is visible there
- Still shows create/complete/fail/delete events for agents

The filtering happens in addEvent() in the TUI feed model. Agent session
updates are identified by parsing the bead ID pattern and checking for
known agent roles (mayor, deacon, witness, refinery, crew, polecat).

Resolves: gt-sb6m4

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:42:57 -08:00
Steve Yegge
e1fed7f72e bd sync: 2025-12-29 23:41:49 2025-12-29 23:41:49 -08:00
Steve Yegge
cbb4641d26 bd sync: 2025-12-29 23:38:28 2025-12-29 23:38:38 -08:00
Steve Yegge
231d524103 bd sync: 2025-12-29 23:38:03 2025-12-29 23:38:38 -08:00
Steve Yegge
002a45ddd1 bd sync: 2025-12-29 23:38:00 2025-12-29 23:38:38 -08:00
Steve Yegge
2844edb541 Instrument gt commands to appear in activity feed (gt-7aw1m)
Phase 1 of activity feed improvements: gt commands now log events to
~/gt/.events.jsonl. This is the raw audit log that the feed daemon
(phase 2) will curate into the user-facing feed.

Instrumented commands:
- gt sling: logs sling events with bead and target
- gt hook: logs hook events with bead
- gt handoff: logs handoff events with subject
- gt done: logs done events with bead and branch
- gt mail send: logs mail events with to and subject

Event format follows the specification:
```json
{"ts":"2025-12-30T07:36:28Z","source":"gt","type":"mail",
 "actor":"gastown/crew/joe","payload":{...},"visibility":"feed"}
```

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:37:50 -08:00
Steve Yegge
fcea70efa1 bd sync: 2025-12-29 23:36:55 2025-12-29 23:36:55 -08:00
Steve Yegge
1bc7ae191a bd sync: 2025-12-29 23:34:59 2025-12-29 23:34:59 -08:00
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