Commit Graph

913 Commits

Author SHA1 Message Date
Steve Yegge
92c04042a6 bd sync: 2025-12-23 13:37:03 2025-12-23 14:08:35 -08:00
Steve Yegge
ced054b118 bd sync: 2025-12-23 13:36:40 2025-12-23 14:08:35 -08:00
Steve Yegge
f228b78382 bd sync: 2025-12-23 13:36:18 2025-12-23 14:08:35 -08:00
Steve Yegge
e7b631efcc bd sync: 2025-12-23 13:35:56 2025-12-23 14:08:35 -08:00
Steve Yegge
fbab402d89 bd sync: 2025-12-23 13:35:34 2025-12-23 14:08:35 -08:00
Steve Yegge
b7fd837258 bd sync: 2025-12-23 13:35:13 2025-12-23 14:08:35 -08:00
Steve Yegge
266818b117 bd sync: 2025-12-23 13:34:52 2025-12-23 14:08:35 -08:00
Steve Yegge
76914a6c57 bd sync: 2025-12-23 13:34:32 2025-12-23 14:08:35 -08:00
Steve Yegge
297a2f85d3 bd sync: 2025-12-23 13:34:12 2025-12-23 14:08:35 -08:00
Steve Yegge
9c85b834cd Support full session paths in gt handoff (gt-tocb)
resolveRoleToSession now accepts paths like <rig>/crew/<name>,
<rig>/witness, and <rig>/refinery in addition to role shortcuts.
For example: 'gt handoff gastown/crew/max' now works.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:25:59 -08:00
Steve Yegge
e804d4d52d bd sync: 2025-12-23 13:25:47 2025-12-23 13:25:47 -08:00
Steve Yegge
0373c34931 bd sync: 2025-12-23 13:20:36 2025-12-23 13:20:36 -08:00
Steve Yegge
1414081e10 Standardize session end with gt handoff (gt-yt6g)
- Update gt handoff to detect polecats (via GT_POLECAT env var) and
  call gt done instead of respawning - polecats have Witness-managed lifecycle
- Update CLAUDE.md Session End Checklist to use gt handoff
- This is the canonical way to end any agent session - it handles mail,
  respawn, and context restoration via SessionStart hook

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:07:26 -08:00
Steve Yegge
6932fcf75d Update role prompts to use gt handoff for session cycling (gt-yt6g)
- crew.md: Use gt handoff instead of manual mail for handoff
- witness.md: Use gt handoff in Session Self-Cycling section
- refinery.md: Simplify Session Self-Cycling to use gt handoff
- deacon.md: Add Session Self-Cycling section with gt handoff

All non-polecat roles now consistently document gt handoff as the
canonical way to end sessions. Polecats use gt done (handled by Witness).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 13:06:31 -08:00
Steve Yegge
e69b71c628 bd sync: 2025-12-23 13:05:18 2025-12-23 13:05:18 -08:00
Steve Yegge
e3500543f3 Fix handoff to set correct working directory for each role
buildRestartCommand now detects the town root and includes a cd to the
appropriate directory before launching claude. This ensures each role
starts in its correct working directory:
- gt-mayor → town root (~/gt)
- gt-deacon → ~/gt/deacon
- crew sessions → ~/gt/<rig>/crew/<name>
- witness sessions → ~/gt/<rig>/witness
- refinery sessions → ~/gt/<rig>/refinery

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 12:59:41 -08:00
Steve Yegge
8d47911623 Fix deacon startup: use ~/gt/deacon dir and export GT_ROLE
The daemon was creating the deacon session in ~/gt (town root) which loaded
the Mayor CLAUDE.md instead of the Deacon CLAUDE.md. Also, tmux SetEnvironment
does not export variables to spawned processes.

Changes:
- Create deacon session in ~/gt/deacon (correct CLAUDE.md)
- Export GT_ROLE=deacon in launch command (process inherits env)
- Apply to both initial launch and restart paths

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 12:39:04 -08:00
Steve Yegge
d8a1c64b8c bd sync: 2025-12-23 12:37:23 2025-12-23 12:37:23 -08:00
Steve Yegge
0d821a734a bd sync: 2025-12-23 12:32:49 2025-12-23 12:32:49 -08:00
Steve Yegge
2afd2a25ce bd sync: 2025-12-23 12:27:24 2025-12-23 12:27:31 -08:00
Steve Yegge
a4f1bf66f0 bd sync: 2025-12-23 12:24:34 2025-12-23 12:27:31 -08:00
Steve Yegge
99b4282554 bd sync: 2025-12-23 12:23:03 2025-12-23 12:27:31 -08:00
Steve Yegge
a1319c7780 bd sync: 2025-12-23 12:16:52 2025-12-23 12:27:31 -08:00
Steve Yegge
757e14c013 bd sync: 2025-12-23 12:15:58 2025-12-23 12:27:31 -08:00
Steve Yegge
5639dd7f84 Document bd pinned field bug in beads.Pin() (gt-o3is)
Added comment explaining that the pinned field gets overwritten by
subsequent bd commands due to a bug in the beads auto-import logic.
The handoff bead attachment mechanism works correctly and is the
primary work assignment mechanism.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 12:27:18 -08:00
Steve Yegge
6383ae6075 Add gt broadcast command to nudge all workers
New command that sends a message to all active workers (polecats + crew).
Supports filtering by rig with --rig flag, and can include infrastructure
agents (mayor, deacon, witness, refinery) with --all flag.

Usage:
  gt broadcast "Check your mail"
  gt broadcast --rig gastown "New work available"
  gt broadcast --all "System maintenance in 5 minutes"
  gt broadcast --dry-run "Test"

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 12:15:25 -08:00
Steve Yegge
0683981d31 bd sync: 2025-12-23 12:14:58 2025-12-23 12:14:58 -08:00
Steve Yegge
5bd6d3cb6f bd sync: 2025-12-23 12:08:48 2025-12-23 12:08:48 -08:00
Steve Yegge
cab9dc9ae8 bd sync: 2025-12-23 12:08:24 2025-12-23 12:08:33 -08:00
Steve Yegge
923f7eddf2 bd sync: 2025-12-23 12:07 2025-12-23 12:08:22 -08:00
Steve Yegge
4b12c40878 bd sync: 2025-12-23 12:08:01 2025-12-23 12:08:01 -08:00
Steve Yegge
67994e46c2 bd sync: 2025-12-23 12:03:33 2025-12-23 12:03:33 -08:00
Steve Yegge
5b399d782d bd sync: 2025-12-23 12:01:31 2025-12-23 12:01:31 -08:00
Steve Yegge
6259b707ce bd sync: 2025-12-23 11:55:27 2025-12-23 11:55:27 -08:00
Steve Yegge
6fac52da7b bd sync: 2025-12-23 11:51:21 2025-12-23 11:51:21 -08:00
Steve Yegge
fc38fb35d7 feat(doctor): add orphaned-attachments check (gt-h6eq.3)
Add doctor check to detect handoff beads for agents that no longer exist.
This happens when a polecat worktree is deleted but its handoff bead remains.

- Check: orphaned-attachments
- Warning if: Handoff bead exists for agent that no longer has worktree
- Supports polecats (rig/name), crew (rig/crew/name), mayor, witness, refinery
- Suggests re-sling to active agent or close the molecule

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:50:31 -08:00
Steve Yegge
e50e714462 bd sync: 2025-12-23 11:47:59 2025-12-23 11:50:31 -08:00
Steve Yegge
90722ee65f feat: add hook status to gt status command (gt-h6eq.6)
Add HookInfo struct and hook discovery to show which agents have work
attached to their hooks. Updates both JSON and text output:

- New HookInfo type with agent, role, has_work, molecule, and title fields
- RigStatus now includes Hooks slice
- StatusSum includes ActiveHooks count
- discoverRigHooks() scans polecats, crew, witness, and refinery
- getAgentHook() retrieves hook status from handoff beads
- Text output shows active hooks per rig with agent and molecule info

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:49:28 -08:00
Steve Yegge
00c64a075c feat: add gt mol attach-from-mail command (gt-h6eq.7)
Allows agents to self-pin work from mail messages. The command:
1. Reads a mail message by ID
2. Extracts molecule ID from the body (attached_molecule:, molecule_id:, etc.)
3. Attaches the molecule to the agent's pinned bead (hook)
4. Marks the mail as read

Includes unit tests for the molecule ID extraction logic.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:44:34 -08:00
Steve Yegge
8be2146a48 docs: update role templates with hook-first startup protocol (gt-h6eq.9)
Updated all role prompt templates to document the startup hook protocol:
- polecat.md.tmpl: Added gt mol status check, self-pin from mail protocol
- witness.md.tmpl: Added gt mol status check, self-pin from mail protocol
- refinery.md.tmpl: Added gt mol status check, self-pin from mail protocol
- crew.md.tmpl: Added new Startup Protocol section with hook-first flow
- deacon.md.tmpl: Added gt mol status check, self-pin from mail protocol
- mayor.md.tmpl: Expanded startup protocol with hook-first flow

Each template now includes:
1. Check hook first (gt mol status)
2. If empty, check mail for attached work
3. Self-pin protocol (gt mol attach-from-mail) if needed
4. Role-specific fallback behavior

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:44:14 -08:00
Steve Yegge
e11833922b bd sync: 2025-12-23 11:43 2025-12-23 11:43:31 -08:00
Steve Yegge
949e1228a6 feat: add gt hooks command to list Claude Code hooks
Add a command to list all hooks in the workspace. Scans for .claude/settings.json
files and displays hooks by type (SessionStart, PreCompact, UserPromptSubmit, etc).

Features:
- Scans town root, rigs, polecats, crew, witness, and refinery directories
- Shows hook type, location, status, and agent that owns it
- Supports --verbose flag to show hook commands
- Supports --json flag for machine-readable output

(gt-h6eq.5)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:42:48 -08:00
Steve Yegge
26a7e54205 feat(doctor): add hook-singleton check (gt-h6eq.1)
Add doctor check to ensure each agent has at most one handoff bead.
Detects when multiple pinned beads exist with the same "{role} Handoff"
title, which can cause confusion about which handoff is authoritative.

- Check: hook-singleton
- Error if: Multiple pinned beads with same '{role} Handoff' title
- Fix: Automatically closes duplicates (keeps oldest) when run with --fix

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:42:35 -08:00
Steve Yegge
d0616870dd beads: add merge request for gt-h6eq.8 2025-12-23 11:42:12 -08:00
Steve Yegge
f2266db12d Add stale-attachments doctor check (gt-h6eq.4)
Implements a new doctor check that detects attached molecules that
haven't been updated in too long, which may indicate stuck work.
The check:
- Finds all pinned beads with attachments across rigs
- Checks the attached molecule's UpdatedAt timestamp
- Reports molecules in_progress with no activity for >1 hour
- Provides actionable fix hints for stuck polecats

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:41:43 -08:00
Steve Yegge
9fa4a42030 feat: add audit trail for detach operations (gt-h6eq.8)
Add DetachMoleculeWithAudit() function that logs detach operations
to .beads/audit.log in JSONL format. Each entry captures:
- timestamp
- operation type (detach, burn, squash)
- pinned_bead_id
- detached_molecule
- detached_by (agent identity)
- reason (optional)
- previous_state

Updated callers:
- runMoleculeDetach: logs "detach" operation
- runMoleculeBurn: logs "burn" operation with reason
- runMoleculeSquash: logs "squash" operation with digest ID

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:40:06 -08:00
Steve Yegge
d3657902a6 bd sync: 2025-12-23 11:39:01 2025-12-23 11:39:01 -08:00
Steve Yegge
78a20f0aad feat(doctor): add hook-attachment-valid check (gt-h6eq.2)
Add doctor check to verify that attached molecules exist and are not closed.
Detects when a hook's attached_molecule field points to a non-existent or
closed issue, which can leave agents with stale work assignments.

- Check: hook-attachment-valid
- Error if: Hook's attached_molecule field points to non-existent or closed issue
- Fix: Automatically detaches invalid molecules when run with --fix

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:34:50 -08:00
Steve Yegge
a473a35fe9 docs: Plugins ARE molecules - remove YAML/markdown format
- Updated molecules.md to reflect actual JSONL storage format
- Updated architecture.md molecule sections with ASCII diagrams
- Replaced markdown "## Step:" format with tree diagrams
- Changed plugin system from directory-based to molecule-based
- Plugins now use labels for metadata (tier, phase, role)
- Mol Mall distributes molecules.jsonl fragments

Related: gt-u818, gt-9za0

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 05:15:32 -08:00
Steve Yegge
91992c7582 bd sync: 2025-12-23 05:14:52 2025-12-23 05:14:52 -08:00