Commit Graph

1369 Commits

Author SHA1 Message Date
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
Steve Yegge
103076cf17 bd sync: 2025-12-25 22:12:49 2025-12-25 22:12:49 -08:00
Steve Yegge
727e337bd8 bd sync: 2025-12-25 22:09:00 2025-12-25 22:09:00 -08:00
Steve Yegge
57a84c6bad Update documentation and priming (gt-xmyha)
- Fix CLAUDE.md: joe→max for correct crew worker identity
- Add TOML formula documentation to molecules.md
- Update wisp-architecture.md with wisp-gc docs
- Update architecture.md with bd formula commands
- Update molecular-chemistry.md with TOML examples
- Add diagnostics section to CLAUDE.md

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 22:06:05 -08:00
Steve Yegge
f7e29236d1 Fix dry-run bug in gt handoff - check before side effects (gt-sq0t3) 2025-12-25 22:06:05 -08:00
Steve Yegge
fa0a5b1288 bd sync: 2025-12-25 22:05:54 2025-12-25 22:05:54 -08:00
Steve Yegge
58147e5318 bd sync: 2025-12-25 22:03:22 2025-12-25 22:03:22 -08:00
Steve Yegge
4a22df2093 bd sync: 2025-12-25 22:00:29 2025-12-25 22:00:37 -08:00
Steve Yegge
60556534da Add TOML versions of formulas (gt-xmyha)
Converted all .formula.json files to .formula.toml using bd formula convert.
TOML provides better ergonomics:
- Multi-line strings without \n escaping
- Human-readable diffs
- Comments allowed

Original JSON files retained for backwards compatibility.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 22:00:00 -08:00
Steve Yegge
db5134175c bd sync: 2025-12-25 21:59:51 2025-12-25 21:59:51 -08:00
Steve Yegge
4c191b1f27 bd sync: 2025-12-25 21:49:45 2025-12-25 21:49:45 -08:00
Steve Yegge
0a38ae3a18 bd sync: 2025-12-25 21:40:11 2025-12-25 21:44:36 -08:00
Steve Yegge
0de7b980f7 Add wisp-gc doctor check, integrate into gt doctor --fix (gt-psj76.2)
- Implement WispGCCheck in internal/doctor/wisp_check.go
  - Scans rigs for wisps older than 1 hour threshold
  - Fix runs `bd --no-daemon wisp gc` in each affected rig
- Register wisp-gc check in gt doctor
- Update help text to document cleanup checks
- Simplify Deacon patrol session-gc step to just use gt doctor --fix

Now `gt doctor --fix` handles all cleanup:
- orphan-sessions: Kill orphaned tmux sessions
- orphan-processes: Kill orphaned Claude processes
- wisp-gc: Garbage collect abandoned wisps (>1h)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 21:44:27 -08:00
Steve Yegge
fc4bddd694 Add gt doctor --fix for session cleanup in Deacon patrol (gt-psj76.2)
The previous commit only fixed wisp gc, but the session cleanup
was also using non-existent commands. Now session-gc step properly
documents:

1. gt doctor --fix for orphaned sessions and processes
2. bd --no-daemon wisp gc for orphaned wisps

Also noted that log pruning and molecule archival are handled
elsewhere (not implemented / bd mol squash|burn respectively).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 21:40:05 -08:00
Steve Yegge
d8886eea32 bd sync: 2025-12-25 21:36:09 2025-12-25 21:36:09 -08:00