Commit Graph

31 Commits

Author SHA1 Message Date
Steve Yegge
b2f1b58f13 feat: implement gt sling and wisp hook system (gt-qvn7.1)
Phase 1 of tracer bullet: Slinging Handoff

- Add internal/wisp package for ephemeral work attachment
- Add gt sling command to attach work and restart
- Update gt prime to check/burn slung work on hook
- Add .beads-wisp/ to gitignore
2025-12-24 16:08:15 -08:00
Steve Yegge
c10709dc3f terminology: spawn → pour/wisp for molecules (gt-9uy0)
Molecules use chemistry verbs, not spawn:
- pour = create persistent mol (liquid)
- wisp = create ephemeral wisp (vapor)
- spawn = polecats only (workers)

Changes:
- Delete chemistry-design-changes.md (migration doc)
- Remove migration tables from sling-design.md
- Update bond tables: Spawn → Pour/Wisp
- Rename spawnMoleculeFromProto → pourMoleculeFromProto
- Rename spawnMoleculeOnIssue → runMoleculeOnIssue
- Update templates: bd mol spawn → bd wisp
- Update prime.go: commands and messages
- Clean all docs and comments

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 14:04:19 -08:00
Steve Yegge
8705e843c7 refactor: replace 'spawn' with 'create/wisp' for molecule terminology (gt-9uy0)
'Spawn' should only be used for polecats (workers). Molecules use:
- bd wisp <proto> - create ephemeral wisp
- bd pour <proto> - create persistent mol

Updated:
- prompts/roles/deacon.md: bd mol spawn → bd wisp
- internal/templates/roles/deacon.md.tmpl: spawn → create/wisp
- internal/templates/roles/witness.md.tmpl: gt mol spawn → bd wisp
- internal/cmd/prime.go: all mol spawn calls → wisp calls
- docs/molecular-chemistry.md: spawn terminology → create/instantiate

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 13:17:22 -08:00
Steve Yegge
5459e8e6b1 Deacon startup: auto-bond mol-deacon-patrol on gt prime
- Add auto-spawn logic to outputDeaconPatrolContext()
- Deacon now auto-spawns mol-deacon-patrol if no active patrol
- All three patrol roles now have consistent auto-bond behavior:
  Deacon, Witness, Refinery

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 01:47:41 -08:00
Steve Yegge
0dac49636c Witness startup: auto-bond mol-witness-patrol on gt prime (gt-lx3n)
- Add outputWitnessPatrolContext() function in prime.go
- Witness now auto-spawns mol-witness-patrol if no active patrol
- Fixed catalog ID parsing (strip trailing colon) for both witness and refinery
- Created mol-witness-patrol template with 10 steps (gt-qflq)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 01:43:49 -08:00
Steve Yegge
8e3beda87c Merge remote-tracking branch 'origin/polecat/dementus' 2025-12-23 01:15:54 -08:00
Steve Yegge
37c2382767 Unify startup protocols: all roles use 'gt mol status' + RUN IT pattern
- Mayor/Crew: mol attached → RUN IT, else await instruction
- Witness/Refinery/Deacon: mol attached → RUN IT, else spawn patrol
- Polecat: mol attached → RUN IT, else ERROR (polecats must have work)
2025-12-23 01:05:48 -08:00
Steve Yegge
6c323b0d1f Crew startup: 'RUN IT' instead of 'AUTO-CONTINUE' for clarity 2025-12-23 00:56:26 -08:00
Steve Yegge
ef1f5ac2f3 Refinery startup: auto-bond mol-refinery-patrol on start
Add outputRefineryPatrolContext to gt prime that automatically spawns
the refinery patrol molecule when no active patrol is found. This ensures
the merge queue is always monitored when Refinery starts up.

Key changes:
- Add RoleRefinery to outputMoleculeContext
- Implement outputRefineryPatrolContext with auto-spawn logic
- Check for existing in-progress or open patrol molecules
- Spawn mol-refinery-patrol wisp if none found

(gt-j6s8)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:10:39 -08:00
Steve Yegge
dbb8f185bd Extend auto-continue to polecats (gt-rp0k)
Rename outputCrewAttachmentStatus to outputAttachmentStatus and extend
to support both RoleCrew and RolePolecat. The Propulsion Principle
("If you find something on your hook, YOU RUN IT.") now applies to
all worker types, not just crew.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 23:49:45 -08:00
Steve Yegge
6ec6fb0d4d feat(prime): Add crew auto-continue for attached work (gt-9g82)
Updates crew worker startup to detect and auto-continue attached molecules:

- prime.go: Add outputCrewAttachmentStatus() that detects pinned beads
  with attached molecules and outputs "AUTO-CONTINUE MODE" directive
- prime.go: Update startup directive to explain the auto-continue pattern
- crew.md: Add "Session Wisp Model" section documenting autonomous work

Key insight: if attached work exists, continue without awaiting input.
This enables overnight autonomous work on long molecules.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 16:14:44 -08:00
Steve Yegge
ae513a5db4 Deacon uses wisp-based patrol (gt-3x0z.9)
Daemon changes:
- Remove checkDeaconAttachment() - Deacon self-spawns wisps
- Remove findDeaconPatrolMolecule() - unused
- Remove nudgeDeaconForPatrol() - unused
- Remove DeaconPatrolMolecule const - unused
- Remove beads import - no longer needed

Deacon template changes:
- Update to wisp-based patrol model
- Replace bd mol run with bd mol spawn (wisps by default)
- Remove pinned molecule concept for patrol
- Add Why Wisps section explaining ephemeral design
- Update startup/handoff protocols for wisp-based cycles

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 02:13:24 -08:00
Steve Yegge
97e0535bfe Implement three-tier config architecture (gt-k1lr tasks 1-5)
**Architecture changes:**
- Renamed `.gastown/` → `.runtime/` for runtime state (gitignored)
- Added `settings/` directory for rig behavioral config (git-tracked)
- Added `mayor/config.json` for town-level config (MayorConfig type)
- Separated RigConfig (identity) from RigSettings (behavioral)

**File location changes:**
- Town runtime: `~/.gastown/*` → `~/.runtime/*`
- Rig runtime: `<rig>/.gastown/*` → `<rig>/.runtime/*`
- Rig config: `<rig>/.gastown/config.json` → `<rig>/settings/config.json`
- Namepool state: `namepool.json` → `namepool-state.json`

**New types:**
- MayorConfig: town-level behavioral config
- RigSettings: rig behavioral config (merge_queue, theme, namepool)
- RigConfig now identity-only (name, git_url, beads, created_at)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 01:22:43 -08:00
Steve Yegge
5d7291962a Rename ephemeral -> wisp terminology throughout Gas Town
- .beads-ephemeral/ -> .beads-wisp/
- Rename doctor checks: EphemeralCheck -> WispCheck
- Update all docs to use 'transient' for polecats, 'wisp' for molecules
- Preserve 'ephemeral' only as descriptive adjective for wisps
- Steam engine metaphor: wisps are steam vapors that dissipate

Part of Christmas launch wisp terminology unification.
2025-12-22 00:55:31 -08:00
Steve Yegge
965644b0fe Add identity collision prevention, detection, and correction (gt-xp2s)
- internal/lock: New package with PID-based lockfiles for worker identity
- gt prime: Acquire identity lock for crew/polecat roles, fail on collision
- gt agents check: Detect stale locks and identity collisions
- gt agents fix: Clean up stale locks
- gt doctor: New identity-collision check with --fix support

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-22 00:05:46 -08:00
Steve Yegge
6051e21015 fix(beads): Auto-create .beads/redirect for crew and polecats
Fixes gt-b6qm: redirect files can get deleted by git clean, causing
"no beads database found" errors.

Changes:
- crew.Manager.Add() now creates .beads/redirect during setup
- gt prime regenerates missing redirects silently on startup

The redirect points to the shared beads database at either:
- rig/mayor/rig/.beads/ (preferred)
- rig/.beads/ (fallback)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:16:45 -08:00
Steve Yegge
2fb9ee67a5 feat(deacon): Add patrol runner context and prime support
Updates Deacon CLAUDE.md template with patrol execution instructions:
- Patrol molecule workflow (mol-deacon-patrol)
- Startup protocol: check for attached molecule, resume or bond
- Patrol execution loop: execute steps, close, loop or exit
- Nondeterministic idempotence for handoff

Enhances gt prime for Deacon:
- Adds patrol status section showing attached/naked state
- Shows molecule progress when patrol is in progress
- Includes Deacon-specific startup directive

Also adds standalone prompts/roles/deacon.md for reference.

Closes: gt-rana.4

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 16:47:47 -08:00
Steve Yegge
308a7bc190 gt-975: Molecule execution support for polecats and crew
Added molecule workflow integration to Gas Town:

1. spawn.go: MoleculeContext in work assignment mail
   - Shows step N/M and molecule ID in subject
   - Includes molecule workflow instructions
   - Guides polecat through DAG execution

2. prime.go: outputMoleculeContext()
   - Detects if in-progress issue is a molecule step
   - Shows molecule progress and next steps
   - Displays molecule work loop instructions

3. molecule.go: 'gt molecule progress' command
   - Shows execution progress for molecule root
   - Displays done/in-progress/ready/blocked steps
   - Progress bar and completion percentage
   - JSON output for Witness automation

This enables polecats to work through molecule DAGs:
- Receive molecule-aware work assignments
- See context in gt prime output
- Follow DAG with 'bd ready --parent <root>'
- Witness can monitor with 'gt molecule progress'

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 12:03:21 -08:00
Steve Yegge
b118b5299b fix(prime): include rig name in Polecat and Crew check-ins
Format is now "<Rig> Polecat <name>, checking in." and
"<Rig> Crew <name>, checking in." to match the pattern.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 00:36:36 -08:00
Steve Yegge
74e397fadb feat(prime): add check-in announcements for all agent roles
Extend the startup protocol to have all roles announce themselves:
- Mayor: "Mayor, checking in." (already present)
- Witness: "Witness, checking in."
- Polecat: "Polecat <name>, checking in."
- Refinery: "Refinery, checking in."
- Crew: "Crew <name>, checking in." (new case added)

This provides consistent startup behavior across all Gas Town agents.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 00:35:30 -08:00
Steve Yegge
5e36cf09dd Merge polecat/nux: fix witness role template mail command 2025-12-20 03:57:05 -08:00
Steve Yegge
d154533d49 feat(refinery): Convert Refinery from Go polling to Claude agent
The Refinery now runs as a Claude agent in a tmux session instead of
a Go-based polling loop. This aligns it with how polecats work and
enables intelligent MR processing.

Changes:
- Modified refinery.Start() to spawn Claude session (not gt refinery --foreground)
- Added gt refinery attach command for interactive access to refinery session
- Updated refinery.md.tmpl with comprehensive Claude agent instructions
- Added startup directive in gt prime for refinery role

The --foreground mode is preserved for backwards compatibility but the
default behavior now launches a Claude agent that can review diffs,
run tests, handle conflicts, and notify workers via mail.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 01:45:20 -08:00
Steve Yegge
bc8a33a028 feat(witness): Implement Witness as Claude agent (gt-xicq)
Convert the Witness from a Go polling loop to a Claude agent with:

- Enhanced witness.md.tmpl with detailed agent instructions:
  - Startup protocol for checking handoffs and polecat status
  - Lifecycle request processing (verify git state, cleanup)
  - Health check protocol for detecting stuck polecats
  - Nudge protocol with 3-strike escalation
  - Escalation protocol for unresolvable issues
  - Session cycling with handoff mail

- Updated gt witness attach to:
  - Create sessions in <rig>/witness/ directory for proper role detection
  - Ensure witness directory exists

- Added startup directive for Witness role in gt prime

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 23:24:51 -08:00
Steve Yegge
71d313ed60 Fix mail read auto-ack and add Mayor startup directive
- Remove auto-ack on mail read so handoff messages persist
- Add STARTUP PROTOCOL directive for Mayor and Polecat roles
- Agents now get explicit instructions to check in on startup

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 22:38:10 -08:00
Steve Yegge
5622abbdfe feat(spawn): Replace tmux injection with persistent mail-based work assignment (ga-yp3)
- gt spawn now sends work assignment to polecat inbox instead of tmux injection
- Add --identity flag to gt mail inbox and gt mail check
- Add --force flag to gt spawn to override existing unread mail
- Update polecat template with startup protocol for reading inbox
- Fix pre-existing lint issue in start.go

The new flow is more reliable:
1. Spawn sends work assignment mail to polecat inbox
2. Polecat starts and runs gt prime
3. gt prime automatically runs gt mail check --inject
4. Polecat reads work assignment from inbox

Benefits:
- Persistence across session restarts
- No racing against Claude initialization
- Audit trail in beads
- Edge case handling for existing unread mail

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 22:07:38 -08:00
Steve Yegge
08face5ac3 Add Deacon role to gt prime
Deacon now gets role-specific context plus shared beads/mail context
like all other roles.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 19:24:07 -08:00
Steve Yegge
caef0e04b2 Unify gt prime to call bd prime and mail check
gt prime now internally runs:
- bd prime (beads workflow context)
- gt mail check --inject (mail injection)

This allows a single SessionStart hook to provide complete agent context.
Also added PreCompact and UserPromptSubmit hooks to settings.json.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 19:13:19 -08:00
Steve Yegge
4edacde590 Implement handoffs using pinned beads (gt-cu7r)
Replace mail-based handoff system with pinned beads that persist
across sessions. This fixes the issue where handoff messages get
closed before successors can read them.

Changes:
- beads: Add StatusPinned constant and handoff functions:
  - HandoffBeadTitle() for well-known naming
  - FindHandoffBead() to locate role handoff bead
  - GetOrCreateHandoffBead() to ensure bead exists
  - UpdateHandoffContent() to set handoff message
  - ClearHandoffContent() to reset after reading

- cmd/handoff: Update to use pinned beads instead of mail
  - sendHandoffMail() now updates pinned bead content

- cmd/prime: Display handoff content on startup
  - outputHandoffContent() reads and shows handoff bead

- cmd/rig: Add reset command with --handoff flag
  - gt rig reset --handoff clears handoff content

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 01:51:14 -08:00
Steve Yegge
f04cc6fe15 feat: add template system for role contexts and messages
Implements gt-u1j.20: Prompt templates using go:embed.

- Add internal/templates package with embedded .md.tmpl files
- Role templates: mayor, witness, refinery, polecat, crew
- Message templates: spawn, nudge, escalation, handoff
- Update gt prime to use templates with fallback to hardcoded output
- Add crew role detection for <rig>/crew/<name>/ paths
- Include Gas Town architecture overview in all role contexts

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 16:59:40 -08:00
Steve Yegge
135fb9323b feat: add gt mail check command and update prime for GGT cutover
- Add 'gt mail check' with --inject flag for Claude Code hooks
- Update Mayor prime output to include mail commands and startup info
- Enables full cutover from PGT 'town' commands to GGT 'gt' commands

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 16:13:06 -08:00
Steve Yegge
a5023c633b feat: add CLI core commands (status, prime, init)
- status: Show town status with rig/polecat/witness counts (--json supported)
- prime: Output role context based on current directory
- init: Initialize a git repo as a Gas Town rig

Closes gt-u1j.10

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:49:48 -08:00