Commit Graph

1317 Commits

Author SHA1 Message Date
Steve Yegge
ee66c931b9 feat(beads): add cycle detection for molecule dependencies
Implement DFS-based cycle detection in ValidateMolecule to catch
circular dependencies in molecule step graphs. The algorithm uses
three-color marking (unvisited/visiting/visited) to detect back
edges that indicate cycles.

When a cycle is detected, the error message shows the cycle path
(e.g., "a -> b -> c -> a") for easy debugging.

Add 4 new tests:
- SimpleCycle: A -> B -> A
- LongerCycle: A -> B -> C -> A
- DiamondNoCycle: ensures valid diamond patterns pass
- CycleInSubgraph: cycle not involving root node

Closes gt-ai1z.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 12:32:21 -08:00
Steve Yegge
bb7f197eef refactor(cmd): extract common manager creation boilerplate
Add getRig() helper in rig_helpers.go that encapsulates the common
boilerplate for finding town root, loading rigs config, and retrieving
a rig. This reduces duplication across 5 get*Manager functions:
- getPolecatManager
- getSessionManager
- getCrewManager
- getRefineryManager
- getWitnessManager

Closes gt-7sqi.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 12:32:21 -08:00
Steve Yegge
5850f8e67b bd sync: 2025-12-21 21:45:59 2025-12-22 12:32:21 -08:00
Steve Yegge
8fb9f9a321 docs: clarify pinned molecule vs handoff mail distinction
Two mechanisms, different purposes:
- Pinned molecule (bd mol run) = What you are working on, tracked by beads
- Handoff mail = Optional context notes for session restarts

Updated templates, architecture.md, and builtin_molecules.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 12:32:21 -08:00
Steve Yegge
4cdc746fd5 bd sync: 2025-12-21 21:37:51 2025-12-22 12:32:21 -08:00
Steve Yegge
1aede3b122 bd sync: 2025-12-21 21:35:34 2025-12-22 12:32:21 -08:00
Steve Yegge
d8d9b278dc bd sync: 2025-12-21 21:16:59 2025-12-22 12:32:21 -08:00
Steve Yegge
91b4b8b4cc 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-22 12:32:21 -08:00
Steve Yegge
5ae7a8415b bd sync: 2025-12-21 21:14:33 2025-12-22 12:32:21 -08:00
Steve Yegge
812ddc5a37 bd sync: 2025-12-21 21:03:32 2025-12-22 12:32:21 -08:00
Steve Yegge
43eb713d25 bd sync: 2025-12-21 18:49:09 2025-12-22 12:32:21 -08:00
Steve Yegge
99c75ca926 bd sync: 2025-12-21 18:48:48 2025-12-22 12:32:21 -08:00
Steve Yegge
1705c14b75 bd sync: 2025-12-21 18:28:51 2025-12-22 12:32:21 -08:00
Steve Yegge
97bfe66acb feat(statusline): Add deacon status line with owl icon
Shows: 🦉 N rigs | 📬 N (unread mail)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 12:32:21 -08:00
Steve Yegge
f41fe53955 bd sync: 2025-12-21 18:05:18 2025-12-22 12:32:21 -08:00
Steve Yegge
f29d4e56ce bd sync: 2025-12-21 18:04:59 2025-12-22 12:32:21 -08:00
Steve Yegge
45e197fe0e bd sync: 2025-12-21 18:04:27 2025-12-22 12:32:21 -08:00
Steve Yegge
8316fc346b bd sync: 2025-12-21 17:53:43 2025-12-22 12:32:21 -08:00
Steve Yegge
4809037316 docs: Add deacon plugin system design
- New docs/deacon-plugins.md with full plugin architecture
- Directory-based discovery at ~/gt/plugins/
- Gate types: cooldown, cron, condition, event
- Parallel execution support via Task tool subagents
- Updated mol-deacon-patrol plugin-run step to reference new docs

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 12:32:21 -08:00
Steve Yegge
ac60318778 bd sync: 2025-12-21 17:30:06 2025-12-22 12:32:21 -08:00
Steve Yegge
42fb28542a bd sync: 2025-12-21 17:26:39 2025-12-22 12:32:21 -08:00
Steve Yegge
8990c79aee bd sync: 2025-12-21 17:26:20 2025-12-22 12:32:21 -08:00
Steve Yegge
794a9ee8a8 feat: Add gt peek command and session communication docs
Adds gt peek as ergonomic alias for gt session capture:
  gt peek gastown/furiosa      # Last 100 lines
  gt peek gastown/furiosa 50   # Last 50 lines

Creates nudge/peek pair as canonical session interface:
  gt nudge - send TO session (reliable delivery)
  gt peek  - read FROM session (capture-pane wrapper)

Adds docs/session-communication.md explaining:
- Why raw tmux send-keys is unreliable for Claude
- The reliable NudgeSession pattern (literal + delay + Enter)
- Command reference and common patterns
- Guidance for template authors

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 12:31:38 -08:00
Steve Yegge
514bcb7e96 feat: Update gt nudge to accept rig/polecat format
Now accepts ergonomic rig/polecat addresses:
  gt nudge gastown/furiosa "Check your mail"

Still supports raw session names for legacy use.
Reuses parseAddress and getSessionManager from session.go.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 12:28:14 -08:00
Steve Yegge
8699b7b3fd fix: Clean polecat .beads/ on spawn to prevent contamination (gt-z3qf)
When polecat branches have .beads/ tracked from previous bd sync operations,
those files would contaminate the new worktree. Now setupSharedBeads():

1. Removes any existing .beads/ contents before creating redirect
2. Points redirect directly to mayor/rig/.beads (matches crew workers)

Also adds sling-design.md documenting the gt sling command design.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 12:22:08 -08:00
Steve Yegge
c9ac8d66c6 bd sync: 2025-12-22 12:20:43 2025-12-22 12:20:43 -08:00
Steve Yegge
ff738051c8 bd sync: 2025-12-22 12:20:24 2025-12-22 12:20:24 -08:00
Steve Yegge
b9cee8f838 bd sync: 2025-12-22 12:19:36 2025-12-22 12:19:36 -08:00
Steve Yegge
9ee95cf630 bd sync: 2025-12-22 12:18:52 2025-12-22 12:18:52 -08:00
Steve Yegge
00003f5b0b docs: Add propulsion principle documentation (gt-7hor)
Write canonical documentation for the Universal Gas Town Propulsion
Principle covering:
- The One Rule (hook has work → work happens)
- Why it works (stateless agents, molecule-driven, beads as control plane)
- The sling lifecycle diagram (spawn → attach → execute → burn)
- Agent startup protocol (gt prime → check attachment → execute or wait)
- Propulsion patterns and anti-patterns
- Nondeterministic idempotence

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 12:18:43 -08:00
Steve Yegge
46595af7aa bd sync: 2025-12-22 12:13:17 2025-12-22 12:13:17 -08:00
Steve Yegge
c0eb252463 bd sync: 2025-12-22 12:12:57 2025-12-22 12:12:57 -08:00
Steve Yegge
dbbdb8d385 bd sync: 2025-12-22 12:12:32 2025-12-22 12:12:32 -08:00
Steve Yegge
e05a9469ac bd sync: 2025-12-22 03:11:47 2025-12-22 03:11:55 -08:00
Steve Yegge
003a4f2236 Fix wisp storage path: rig root not mayor/rig (gt-nq6j)
Wisps are at <rig>/.beads-wisp/, outside any git clone.
This matches the actual code implementation.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 03:11:41 -08:00
Steve Yegge
4b48cd8564 bd sync: 2025-12-22 02:59:06 2025-12-22 02:59:06 -08:00
Steve Yegge
5f29a3d07f Update wisp-architecture.md: shared storage for rig patrols (gt-nq6j)
- All rig patrols (Deacon, Witness, Refinery) now share mayor/rig/.beads-wisp/
- Removed separate wisp directories for witness/ and refinery/
- Polecats do not use wisps (each assignment has audit value)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 02:58:36 -08:00
Steve Yegge
98c48f0f29 bd sync: 2025-12-22 02:48:52 2025-12-22 02:48:52 -08:00
Steve Yegge
80677e1e24 bd sync: 2025-12-22 02:37:12 2025-12-22 02:37:12 -08:00
Steve Yegge
208262e728 bd sync: 2025-12-22 02:14:12 2025-12-22 02:14:12 -08:00
Steve Yegge
96a6ae7d4e bd sync: close gt-3x0z.9 (wisp-based patrol) 2025-12-22 02:14:06 -08:00
Steve Yegge
21e51d7bc8 bd sync: 2025-12-22 02:13:56 2025-12-22 02:13:56 -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
3154d0534c bd sync: 2025-12-22 02:11:09 2025-12-22 02:11:09 -08:00
Steve Yegge
e7efe11cc8 Add molecular chemistry documentation (gt-3x0z.9)
New documents:
- docs/molecular-chemistry.md: Comprehensive guide to the chemistry metaphor
  for work composition. Covers all phases (proto/mol/wisp), transitions
  (pour/wisp/squash/burn/distill), polymorphic bond operator, and the
  thermodynamic properties of the work execution engine.

- docs/chemistry-design-changes.md: Implementation roadmap for realizing
  the chemistry UX in Beads and Gas Town. Includes specifications for
  new commands (bd pour, bd wisp, bd pin, bd hook) and migration notes.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 01:59:02 -08:00
Steve Yegge
f3c961096a Complete three-tier config migration (gt-k1lr)
- Add doctor checks for new config architecture:
  - SettingsCheck: Verify rigs have settings/ directory
  - RuntimeGitignoreCheck: Verify .runtime/ is gitignored
  - LegacyGastownCheck: Detect/remove old .gastown/ dirs
- Update .gitignore to include .runtime/
- Update architecture.md with new directory structure
- Update hq.md to clarify PGT vs GGT config locations

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 01:33:36 -08:00
Steve Yegge
6e8c34452a bd sync: 2025-12-22 01:33:26 2025-12-22 01:33:26 -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
f16ce2d634 bd sync: 2025-12-22 01:22:33 2025-12-22 01:22:33 -08:00
Steve Yegge
ec8ba53e07 bd sync: 2025-12-22 01:04:51 2025-12-22 01:04:51 -08:00