Commit Graph

1667 Commits

Author SHA1 Message Date
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
Steve Yegge
251642b7ce fix: Use StatusHooked instead of StatusPinned for hook queries
The hook mechanism was broken because gt hook sets status=hooked
but gt mol status was querying for status=pinned.

Adds StatusHooked constant and updates queries accordingly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:55:51 -08:00
Steve Yegge
8b54292f7b bd sync: 2025-12-29 14:52:02 2025-12-29 14:55:51 -08:00
Steve Yegge
c5520ee229 bd sync: 2025-12-29 14:51:47 2025-12-29 14:55:51 -08:00
Steve Yegge
c92b11d1bd feat: Standardize agent bead naming to prefix-rig-role-name (gt-zvte2)
Implements canonical naming convention for agent bead IDs:
- Town-level: gt-mayor, gt-deacon (unchanged)
- Rig-level: gt-<rig>-witness, gt-<rig>-refinery (was gt-witness-<rig>)
- Named: gt-<rig>-crew-<name>, gt-<rig>-polecat-<name> (was gt-crew-<rig>-<name>)

Changes:
- Added AgentBeadID helper functions to internal/beads/beads.go
- Updated all ID generation call sites to use helpers
- Fixed session parsing in theme.go, statusline.go, agents.go
- Updated doctor check and fix to use canonical format
- Updated tests for new format

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:54:37 -08:00
Steve Yegge
1b20e1bd2c feat: Auto-detect crew name in gt crew start from cwd
When run from inside a crew directory like gastown/crew/joe, the command
now auto-detects the crew workspace name instead of requiring it as an
argument. This matches the existing behavior of 'gt crew at'.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:51:26 -08:00
Steve Yegge
3c6019ae73 fix: Add logging guidance for no-idle-polecats case in swarm dispatch
When ready tasks exist but no idle polecats are available, the Witness
should log the situation rather than silently skip.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:36:29 -08:00
Steve Yegge
ef0008ea2c feat: Add swarm dispatch to Witness patrol (gt-kc7yj.2)
Add dispatch-swarm-work step to mol-witness-patrol formula that:
- Queries bd ready --parent=<epic> to find ready swarm tasks
- Finds idle polecats via agent beads
- Dispatches work via gt sling <task> <rig>/<polecat>

Also updated:
- SWARM mail handling to store epic_id in labels
- check-swarm-completion to use beads discovery model

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:19:26 -08:00
Steve Yegge
7acfcfc4c4 bd sync: 2025-12-29 14:10:44 2025-12-29 14:10:44 -08:00
Steve Yegge
665a815379 bd sync: 2025-12-29 14:06:37 2025-12-29 14:06:37 -08:00
Steve Yegge
4df3dbeadd bd sync: 2025-12-29 14:05:50 2025-12-29 14:06:15 -08:00
Steve Yegge
52e9b48400 feat: Add slot fields to Issue struct and set role slot on create
- Add HookBead and RoleBead fields to Issue struct for JSON unmarshal
- CreateAgentBead now calls bd slot set to set role slot properly
- This ensures role_bead is stored as a first-class field, not just
  embedded in description text

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:05:40 -08:00
Steve Yegge
c6ba5361ad fix: Use shared role beads consistently
All agent bead creation now uses shared role beads:
- gt-mayor-role, gt-deacon-role
- gt-witness-role, gt-refinery-role
- gt-crew-role, gt-polecat-role

Previous code created per-instance role bead references like
gt-witness-gastown-role which is wrong. Role beads are shared
class definitions, not per-instance.

Files fixed:
- internal/rig/manager.go
- internal/doctor/agent_beads_check.go
- internal/cmd/prime.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:05:40 -08:00
Steve Yegge
99b978e547 bd sync: 2025-12-29 13:43:26 2025-12-29 13:43:26 -08:00
Steve Yegge
a4c1932ec4 bd sync: 2025-12-29 13:42:49 2025-12-29 13:43:07 -08:00
Steve Yegge
f2c76304e9 fix: Agent beads now reference shared role beads
crew_add.go: Use gt-crew-role instead of per-instance role bead
polecat/manager.go: Add RoleBead field pointing to gt-polecat-role

Per agent-as-bead design, role beads are shared class definitions.
Each agent bead references its role via the role_bead field/slot.

Fixes gt-ne9he

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 13:42:37 -08:00
Steve Yegge
7f03d3a398 bd sync: 2025-12-29 13:41:52 2025-12-29 13:41:52 -08:00
Steve Yegge
fd6fe23d2a bd sync: 2025-12-29 13:04:27 2025-12-29 13:04:27 -08:00
Steve Yegge
ab141eb9f5 bd sync: 2025-12-29 12:49:40 2025-12-29 12:49:40 -08:00
Steve Yegge
608d56937e feat: gt sling uses status=hooked and wakes witness+refinery (gt-fbz1z, gt-arjlu) 2025-12-29 12:49:24 -08:00
Steve Yegge
d85fc883ca bd sync: 2025-12-29 12:44:34 2025-12-29 12:44:34 -08:00
Steve Yegge
1c8e936172 fix: Add refinery/witness identity detection to detectSender (gt-agtwd) 2025-12-29 12:44:17 -08:00
Steve Yegge
fd08d7a860 fix: Purge 1653 tombstones via bd compact --purge-tombstones 2025-12-28 23:43:02 -08:00
Steve Yegge
b32eb0f9b8 chore: cleanup 1653 old tombstones to reduce issue count 2025-12-28 23:27:02 -08:00
Steve Yegge
00c7980185 chore: Clean orphaned dependencies 2025-12-28 22:50:42 -08:00
Steve Yegge
5c59e43ad3 chore: Purge 1676 tombstones from issues.jsonl 2025-12-28 22:49:10 -08:00
Steve Yegge
3df25d5e79 bd sync: 2025-12-28 22:41:22 2025-12-28 22:41:22 -08:00
Steve Yegge
76b53d9bbc bd sync: 2025-12-28 22:41:17 2025-12-28 22:41:17 -08:00
Steve Yegge
344b8098b4 bd sync: 2025-12-28 22:30:19 2025-12-28 22:30:19 -08:00
Steve Yegge
cff4c5c133 bd sync: 2025-12-28 22:30:07 2025-12-28 22:30:07 -08:00
Steve Yegge
72b5c05d65 Refactor gt swarm to use beads backing (gt-kc7yj.1)
Replace .runtime/swarms.json with beads-backed swarm tracking:

- gt swarm create: calls bd create --type=epic --mol-type=swarm
- gt swarm status: calls bd swarm status
- gt swarm list: calls bd list --mol-type=swarm --type=epic
- gt swarm start: uses bd swarm status to find ready tasks
- gt swarm land: checks completion via bd, closes epic
- gt swarm cancel: closes epic with cancelled reason

Removed:
- SwarmStore type and LoadSwarmStore/Save functions
- Old spawnSwarmWorkers (replaced with spawnSwarmWorkersFromBeads)
- Unused helper functions (stateStyle, taskStateIcon, matchesStatus)

This implements "discovery over tracking" principle from swarm-architecture.md:
swarm state is now derived from beads epic/issue statuses rather than
maintaining separate state in .runtime/swarms.json.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 22:11:38 -08:00
Steve Yegge
90eeb0135d Add gt rig reboot command
Combines shutdown + boot for convenience when restarting patrol agents
after polecats complete work.

Usage:
  gt rig reboot gastown
  gt rig reboot beads --force

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 21:45:39 -08:00
Steve Yegge
a28a702dc5 bd sync: 2025-12-28 21:42:09 2025-12-28 21:42:09 -08:00
Steve Yegge
8976615ccb bd sync: 2025-12-28 21:39:03 2025-12-28 21:39:03 -08:00
Steve Yegge
b389388f39 Add mail display to gt status (gt-um4iu)
- Show unread mail count and first message subject for each agent
- Display format: "mail: 📬 N unread → Subject..."
- Only shows mail line when agent has unread messages
- Fix agent bead ID generation for global agents (mayor/, deacon/)

Example output:
  🏭 Refinery
     gt-refinery-gastown running
       hook: refinery Handoff
       mail: 📬 8 unread → MERGE_READY morsov

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 20:51:39 -08:00
Steve Yegge
8c19752432 Enhance gt status with detailed agent bead view (gt-um4iu)
- Show full agent bead ID for each agent (e.g., gt-crew-gastown-joe)
- Display hook/pinned work with bead ID and title
- Use role icons and section separators for clarity
- Fall back to hooks array when agent bead lacks hook_bead field

Example output:
  🎩 Mayor
     gt-mayor running
       hook: (none)

  ─── gastown/ ───────────────────────
  🏭 Refinery
     gt-refinery-gastown running
       hook: refinery Handoff

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 20:45:51 -08:00
Steve Yegge
2f354b1ef6 Enhance gt status with tree-style role hierarchy view (gt-um4iu)
- Use tree characters (├── └── │) for hierarchical display
- Group agents by role type (Witness, Refinery, Crew, Polecats)
- Add role icons (🎩 Mayor, 🔔 Deacon, 👁 Witness, 🏭 Refinery, 👷 Crew, 😺 Polecats)
- Show pinned work inline with truncation
- Fix unused import in polecat/manager.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 19:36:15 -08:00
Steve Yegge
7606bc884a feat: Add gt rig boot command to start witness and refinery
Inverse of 'gt rig shutdown'. Starts rig patrol agents:
- Checks tmux sessions to avoid duplicates
- Starts witness if not running
- Starts refinery if not running
- Reports what was started vs skipped

Also adds ProcessExists util function needed by witness/refinery managers.
2025-12-28 19:19:10 -08:00
Steve Yegge
cdbe5d0a1e bd sync: 2025-12-28 19:06:47 2025-12-28 19:06:47 -08:00
Steve Yegge
72721cb07f Merge rictus: polecat nuke 2025-12-28 18:45:45 -08:00
Steve Yegge
c94c3f462f Merge nux: process util 2025-12-28 18:45:36 -08:00
Steve Yegge
71968c6623 Merge ace: polecat focus 2025-12-28 18:45:24 -08:00
Steve Yegge
d72e86493e Merge morsov: AgentIdentity, session helpers 2025-12-28 18:45:14 -08:00