Commit Graph

1383 Commits

Author SHA1 Message Date
Steve Yegge
2117eb66f5 feat: Add tmux crash detection hooks (gt-i9s7o)
- Add SetPaneDiedHook to tmux package for crash detection
- Add gt log crash subcommand for hook callback
- Set pane-died hook when starting polecat sessions
- Distinguish exit types: 0=done, 130=kill (Ctrl+C), other=crash
- Rename townlog/townlog.go to townlog/logger.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 16:18:44 -08:00
Steve Yegge
490c8b6e24 bd sync: 2025-12-26 16:14:22 2025-12-26 16:14:30 -08:00
Steve Yegge
8131052207 Deprecate hook files, use pinned beads for propulsion (gt-rgd9x)
Replace hook file mechanism with discovery-based pinned beads:
- gt hook: now runs bd update <bead> --status=pinned
- gt sling: same, plus nudge to target
- gt handoff: same when bead ID provided
- gt prime: checks pinned beads instead of hook files
- gt mol status: no longer checks hook files

Key changes:
- outputAttachmentStatus: extended to all roles (was Crew/Polecat only)
- checkSlungWork: now queries pinned beads instead of reading hook files
- wisp/io.go functions: marked deprecated with migration notes

This follows Gas Town discovery over explicit state principle.
Hook files are kept for backward compatibility but no longer written.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 15:56:11 -08:00
Steve Yegge
2dcb3d9971 bd sync: 2025-12-26 15:54:12 2025-12-26 15:54:12 -08:00
Steve Yegge
ad35855e93 feat: Auto-spawn polecats when gt sling targets a rig (gt-1py3y)
When `gt sling <bead> <rig>` is used with a rig name as target, sling now
automatically spawns a fresh polecat and slings work to it. This provides
a simpler alternative to `gt spawn --issue <bead> <rig>` for quick dispatch.

Changes:
- Add IsRigName() helper to detect bare rig names
- Add SpawnPolecatForSling() for lightweight polecat creation
- Update sling to detect rig targets and auto-spawn
- Update help text for both sling and spawn to document behavior

Design: spawn and sling remain distinct commands with different purposes:
- sling: Light spawn with hook + nudge (quick dispatch)
- spawn: Full workflow with mol-polecat-work, mail, witness notification

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 15:52:40 -08:00
Steve Yegge
e2b8f16c48 Implement town activity logging (gt-ewzon)
Add centralized logging for Gas Town agent lifecycle events:
- spawn: new agent created
- wake: agent resumed
- nudge: message injected
- handoff: agent handed off
- done: agent finished work
- crash: agent exited unexpectedly
- kill: agent killed intentionally

Implementation:
- Add internal/townlog package with LogEvent() function
- Log to ~/gt/logs/town.log with human-readable format
- Add gt log command to view/tail/filter logs
- Integrate logging into spawn, nudge, handoff, done, stop, session commands

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 15:51:54 -08:00
Steve Yegge
d524f65af3 bd sync: 2025-12-26 15:51:39 2025-12-26 15:51:39 -08:00
Steve Yegge
af7810a81b bd sync: 2025-12-26 15:44:51 2025-12-26 15:44:51 -08:00
Steve Yegge
8cdbf1e6bd feat: Add --args flag for natural language executor instructions (gt-1py3y)
- Add Args field to SlungWork struct in wisp/types.go
- Add --args/-a flag to gt sling command
- Display args in gt prime autonomous mode
- Display args in gt mol status output

The --args string is stored in the hook and shown to the LLM executor,
which interprets the instructions naturally without schema maintenance.

Example: gt sling beads-release --args "patch release"

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 14:58:07 -08:00
Steve Yegge
fa16c64346 bd sync: 2025-12-26 14:16:57 2025-12-26 14:16:57 -08:00
Steve Yegge
0e90fca49f Simplify Witness patrol: linear + Task tool, no Christmas Ornament (gt-p3v5n)
Design pivot:
- Remove mol-polecat-arm and dynamic bonding pattern
- Replace with linear patrol (Deacon-style) + Task tool parallelism
- Cleanup wisps as finalizers (marker wisp = pending cleanup)
- Discovery over tracking (no persistent nudge counts)

New docs:
- polecat-lifecycle.md: step-based restart model, evolution path
- witness-patrol-design.md: simplified, terse

Closed obsolete issues: gt-p3v5n.1 through gt-p3v5n.4

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 14:16:41 -08:00
Steve Yegge
1df41e23c7 bd sync: 2025-12-26 13:20:56 2025-12-26 13:36:32 -08:00
Steve Yegge
36eb38be82 Crew sessions: use respawn-pane for cleaner lifecycle (gt-09i4)
Replace SendKeys approach with respawn-pane -k when starting Claude
in crew sessions. This gives cleaner exit behavior:
- Before: Claude exits → shell prompt → exit shell → session ends
- After: Claude exits → session ends (no intermediate shell)

Changes:
- Add GetPaneID() to tmux package for pane ID retrieval
- Update crew_at.go to use RespawnPane for both new and restart cases
- Remove unnecessary waits and multi-step Claude startup

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 13:20:50 -08:00
Steve Yegge
e8a50e5cbf bd sync: 2025-12-26 13:20:31 2025-12-26 13:20:31 -08:00
Steve Yegge
8fff42fde7 test: Add integration tests for gt mol step done
Tests cover:
- extractMoleculeIDFromStep: parsing step IDs (gt-xxx.N format)
- findNextReadyStep: dependency-aware step selection
- Step done scenarios: continue, done, blocked

Also fixes:
- Handle trailing dot in step IDs (gt-abc. -> error)
- Skip in_progress steps when finding next ready step

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 13:20:14 -08:00
Steve Yegge
b7f9ce7215 bd sync: 2025-12-26 13:20:03 2025-12-26 13:20:03 -08:00
Steve Yegge
63bdf2ee33 feat: Add gt mol step done for auto-continuing molecule steps (gt-5gq8r)
Implements the canonical way for polecats to complete molecule steps:
1. Closes the completed step (bd close)
2. Extracts molecule ID from step ID (gt-xxx.1 -> gt-xxx)
3. Finds next ready step (dependency-aware)
4. If next step: updates hook and respawns pane
5. If complete: burns hook and signals witness

This enables instant step transitions (~5-10s) vs waiting for witness
patrol cycles (minutes), and ensures the activity feed stays accurate.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 13:15:17 -08:00
Steve Yegge
74d59e3e13 bd sync: 2025-12-26 13:09:41 2025-12-26 13:09:41 -08:00
Steve Yegge
1eff87eda9 bd sync: 2025-12-26 12:51:01 2025-12-26 12:51:01 -08:00
Steve Yegge
015bda6c59 bd sync: 2025-12-26 00:52:49 2025-12-26 00:53:00 -08:00
Steve Yegge
5b719b2f60 Make gt witness attach infer rig from cwd when no arg provided
Align witness attach command with crew at and refinery attach by using
MaximumNArgs(1) instead of ExactArgs(1) and inferring the rig from the
current working directory when no argument is provided.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 00:52:41 -08:00
Steve Yegge
93bcdd6969 docs: Add formula evolution predictions and future directions
Captures institutional knowledge about:
- Formula resolution hierarchy
- Combinator algebra (>>, |, wrap, inject, extends)
- Higher abstractions (constraints, adaptive, schemas)
- Mol Mall architecture predictions
- Distribution scenarios

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 00:37:05 -08:00
Steve Yegge
7029515451 Code review fixes for park/resume commands (gt-twjr5.5)
- Remove dead sendGateWakeMail function (logic in gate.go)
- Extract parkedWorkPath helper to reduce duplication
- Handle deleted/inaccessible gates in resume gracefully
- Remove unused mail/workspace imports

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 00:10:56 -08:00
Steve Yegge
df3cbf42f2 bd sync: 2025-12-25 23:54:10 2025-12-25 23:54:10 -08:00
Steve Yegge
1c08ba8446 bd sync: 2025-12-25 23:53:52 2025-12-25 23:54:00 -08:00
Steve Yegge
9f14db8f76 Add gt park/resume commands for async gate coordination (gt-twjr5.5)
Implements agent parking and resumption on gates:
- gt park <gate-id>: Parks work on a gate, saves context
- gt resume: Checks for cleared gates and restores work
- gt gate wake: Sends wake mail to waiters when gate closes

These commands enable agents to safely suspend work while waiting
for external conditions (timers, CI, human approval) and resume
when gates clear.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:53:34 -08:00
Steve Yegge
70c7bedefd bd sync: 2025-12-25 23:53:23 2025-12-25 23:53:23 -08:00
Steve Yegge
58c2288647 feat(formula): Add beads-release workflow
Moved from beads repo - formulas are Gas Town orchestration,
not beads primitives.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:47:48 -08:00
Steve Yegge
8e5a9a39d1 bd sync: 2025-12-25 23:44:46 2025-12-25 23:44:46 -08:00
Steve Yegge
02b8164eba bd sync: 2025-12-25 23:14:19 2025-12-25 23:19:47 -08:00
Steve Yegge
efb2afbcca Add gt up --restore for crew and polecat restoration
Features:
- Add CrewConfig to RigSettings (settings/config.json)
- Add --restore flag to gt up
- Crew startup from natural language preferences (e.g., 'max', 'joe and max', 'all')
- Polecat restoration from hook files (work attached)

Example rig settings:
  {"crew": {"startup": "max"}}

Usage:
  gt up --restore

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:18:46 -08:00
Steve Yegge
34b5a3bb8d Document intentional error suppressions with comments (gt-zn9m)
All 156 instances of _ = error suppression in non-test code now have
explanatory comments documenting why the error is intentionally ignored.

Categories of intentional suppressions:
- non-fatal: session works without these - tmux environment setup
- non-fatal: theming failure does not affect operation - visual styling
- best-effort cleanup - defer cleanup on failure paths
- best-effort notification - mail/notifications that should not block
- best-effort interrupt - graceful shutdown attempts
- crypto/rand.Read only fails on broken system - random ID generation
- output errors non-actionable - fmt.Fprint to io.Writer

This addresses the silent failure and debugging concerns raised in the
issue by making the intentionality explicit in the code.

Generated with Claude Code https://claude.com/claude-code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:14:29 -08:00
Steve Yegge
99b1a11cbd Make mol-town-shutdown idempotent and safe (gt-ioij)
v2 changes:
- Add preflight-check step (scan for blockers/warnings)
- Rename kill-polecats → stop-sessions (preserve sandboxes)
- Stop Claude processes but leave git clones and hooks intact
- Polecats can resume from hooks after restart
- Don't clear crew inboxes (user-managed)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:04:51 -08:00
Steve Yegge
5f9c4a335a bd sync: 2025-12-25 23:00:14 2025-12-25 23:00:29 -08:00
Steve Yegge
47168adc1e Add mol-town-shutdown formula for clean town reboot (gt-ioij)
Steps: clear inboxes, kill polecats, stop daemon, rotate logs,
sync state, send handoff, restart daemon.

Usage: gt sling mol-town-shutdown mayor

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:00:08 -08:00
Steve Yegge
1efa5b1ff8 bd sync: 2025-12-25 22:59:49 2025-12-25 22:59:49 -08:00
Steve Yegge
1cec13da74 Fix bd mol -> gt mol command references in docs (gt-ingm.5)
bd mol does not have attach/detach commands - those are Gas Town
orchestrator concerns, so they live in gt mol.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 22:55:11 -08:00
Steve Yegge
cac69a2172 bd sync: 2025-12-25 22:55:01 2025-12-25 22:55:01 -08:00
Steve Yegge
8f910bbf4c bd sync: 2025-12-25 22:45:45 2025-12-25 22:45:58 -08:00
Steve Yegge
f7d7f27d92 Fix gt sling code review issues (gt-z9qoo)
- Fix hook location for remote targets using tmux.GetPaneWorkDir()
- Add --var/--on conflict error check
- Add warning for JSON parse fallback (not yet fatal)
- Capture stderr for wisp command
- Remove dead code: detectAgentIdentity(), detectAgentIdentityForHook(),
  detectCloneRootForHook()
- Extract resolveSelfTarget() helper to reduce role-switching duplication

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 22:45:33 -08:00
Steve Yegge
954457731d bd sync: 2025-12-25 22:45:07 2025-12-25 22:45:07 -08:00
Steve Yegge
cb47c2a790 bd sync: close gt-twjr5.2 (timer gate evaluation) 2025-12-25 22:36:48 -08:00
Steve Yegge
48c0647e47 bd sync 2025-12-25 22:35:10 -08:00
Steve Yegge
86c278fbad Add directory discipline section to mayor priming
- Fix gastown/mayor/rig/CLAUDE.md (had wrong crew content)
- Add CRITICAL: Directory Discipline section to mayor.md.tmpl
- Emphasizes working from mayor/rig/, not crew/* or town root
2025-12-25 22:35:10 -08:00
Steve Yegge
4b02178987 bd sync: 2025-12-25 22:33:32 2025-12-25 22:35:10 -08:00
Steve Yegge
f82d06a82b bd sync: 2025-12-25 22:29:32 2025-12-25 22:35:10 -08:00
Steve Yegge
9daee341ac gt sling: support standalone formula slinging (gt-z9qoo)
When first arg is a formula (not a bead), sling now:
1. Cooks the formula (bd cook)
2. Creates a wisp instance (bd wisp)
3. Attaches the wisp to the target hook
4. Nudges the target to start

New flags:
- --var key=value: Pass variables to formula (repeatable)

Examples:
  gt sling mol-town-shutdown mayor/
  gt sling towers-of-hanoi --var disks=3

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 22:33:25 -08:00
Steve Yegge
e7dfc58a02 Add gate-evaluation step to Deacon patrol (gt-twjr5.2)
New step evaluates pending async gates each patrol cycle:
- Lists open gates via bd gate list
- For timer gates, checks if elapsed time exceeds timeout
- Closes elapsed gates and notifies waiters
- Runs in parallel with trigger-pending-spawns

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 22:29:27 -08:00
Steve Yegge
39faf79322 Fix polecat auto-start by triggering pending spawns in daemon heartbeat (gt-iu23)
The daemon now calls triggerPendingSpawns() on each heartbeat, which:
- Checks for POLECAT_STARTED messages in Deacon inbox
- Polls pending spawns with WaitForClaudeReady (2s timeout)
- Nudges ready polecats with Begin message
- Prunes stale pending spawns (>5 min old)

This ensures polecats get triggered even when Deacon is not in an
active patrol cycle. Uses bootstrap mode regex detection which
is acceptable for daemon operations.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 22:13:31 -08:00
Steve Yegge
9fff048744 bd sync: 2025-12-25 22:13:20 2025-12-25 22:13:20 -08:00