Commit Graph

533 Commits

Author SHA1 Message Date
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
Steve Yegge
5613fbe36c bd sync: 2025-12-22 01:04:10 2025-12-22 01:04:10 -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
ebbe886d81 Fix crew worker mail identity mismatch (gt-2xiv)
Normalize crew/ and polecats/ to canonical form in addressToIdentity():
- gastown/crew/dave -> gastown/dave
- gastown/polecats/Toast -> gastown/Toast

Follows Postels Law: be liberal in what you accept.
2025-12-22 00:40:43 -08:00
Steve Yegge
ed089cbd17 Add role-based theming with layered config and doctor check
Role themes:
- witness: rust (red/alert)
- refinery: plum (purple)
- crew/polecat: inherit rig theme

Resolution order:
1. Per-rig role override (rig/.gastown/config.json role_themes)
2. Global role default (mayor/town.json theme.role_defaults)
3. Built-in role defaults
4. Rig theme (config or hash-based)

Config schema:
- TownConfig.Theme.RoleDefaults: global role->theme map
- RigConfig.Theme.RoleThemes: per-rig role overrides

Doctor check:
- Detects sessions with outdated theme format (brackets)
- Fixable with 'gt theme apply --all'

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 00:39:50 -08:00
Steve Yegge
ad0b7b7f6a Add --all flag to gt theme apply, fix session handling
- Add --all/-a flag to apply themes across all rigs, not just current
- Add proper handling for deacon and witness sessions in theme apply
- Fix crew status line to show full path: rig/crew/name

Previously, gt theme apply only applied to sessions in the current rig,
and skipped deacon/witness sessions due to different naming patterns.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 00:32:47 -08:00
Steve Yegge
47ce32c6c1 Fix crew status line to show full path: rig/crew/name
The status-left for crew members was showing just rig/name (e.g.,
"gastown/max") instead of the full path (e.g., "gastown/crew/max").

This makes crew member identity clearer in the tmux status bar, matching
the mail address format used elsewhere.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 00:27:19 -08:00
Steve Yegge
8cf15ded35 Add rotating MOTD messages to deacon heartbeat
The deacon patrol role is thankless - it gets a nudge every minute.
This adds rotating motivational and educational tips to make it more fun.
Messages include gratitude, encouragement, and tips about Gas Town.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 00:18:00 -08:00
Steve Yegge
6253b97d41 Remove caveman handoff file 2025-12-22 00:14:20 -08:00
Steve Yegge
5b44c63838 Add handoff for deacon MOTD feature 2025-12-22 00:12:43 -08:00
Steve Yegge
bd57858c33 Remove redundant role icons from status-right
The role icon is already shown on the left side of the status bar,
so repeating it on the right wastes space. Removed from:
- Mayor (🎩)
- Deacon (🦉)
- Witness (👁)
- Refinery (🏭)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 00:07:03 -08:00
Steve Yegge
412418ff75 bd sync: 2025-12-22 00:05:55 2025-12-22 00:05:55 -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
97db49f72c Add wisp architecture documentation
- Create wisp-architecture.md with canonical storage spec
- Document role assignments (Deacon/Witness/Refinery use wisps)
- Specify .beads-ephemeral/ as gitignored storage
- Define patrol execution pattern with required squash
- Update architecture.md to reference new doc

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 23:35:55 -08:00
Steve Yegge
fad9e1a5f6 bd sync: 2025-12-21 23:11:40 2025-12-21 23:35:55 -08:00
Steve Yegge
c975d56b9e Use 😺 emoji instead of 'polecats' text in status bars
More compact and visually consistent with other emoji indicators.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 23:33:02 -08:00
Steve Yegge
569e376efc Enhance deacon, witness, and refinery status lines
Deacon:
- Now shows both rig count and polecat count
- Added mail preview (40 chars)

Witness:
- Shows polecat count and crew count (if any)
- Added mail preview (35 chars)

Refinery:
- Shows current item being merged (issue ID) instead of generic +1
- Shows queue count when items pending
- Added mail preview (30 chars)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 23:31:28 -08:00
Steve Yegge
7542cf7596 Show current work (in_progress issues) in crew/polecat status bar
- Added GetPaneWorkDir to tmux package to get pane current directory
- Added getCurrentWork helper that queries beads for in_progress issues
- Worker status line now shows first in_progress issue (ID: title)
- Falls back to GT_ISSUE env var if set, or empty if no work in progress
- Truncated to 40 chars to fit status bar

Example: 👷 gt-44wh: Polecats must not create GitHu… |

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 23:26:54 -08:00
Steve Yegge
c1d090bbc6 Compact status bar left side, expand mail preview to 45 chars
Left side simplified:
- Before: 🎩 [Mayor] coordinator (25+ chars)
- After:  🎩 Mayor (10 chars)
- Icon already identifies role, no need for redundancy

Right side expanded:
- status-right-length: 50 → 80
- Mail preview: 20-25 → 45 chars
- Shows more useful context at a glance

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 23:22:00 -08:00
Steve Yegge
465d8b77a3 Show mail subject preview inline in status bar
Instead of just showing unread count, display truncated subject of first
unread message directly in the status bar. More useful than click-to-view
since terminal mouse support varies.

- Mayor: 20 char limit for subject preview
- Worker (crew/polecat): 25 char limit
- Falls back to count if subject unavailable

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 23:19:08 -08:00
Steve Yegge
b254b4b3f8 Add clickable mail preview in tmux status bar
- New `gt mail peek` command shows compact preview of first unread message
- Left-click on status-right (mail icon area) opens popup with mail preview
- Popup shows subject, sender, body preview (truncated to 500 chars)
- Shows count of additional unread messages if any
- Silent exit (code 1) when no unread mail

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 23:14:08 -08:00
Steve Yegge
19fd7e05b2 Fix witness session parsing in categorizeSession
Witness sessions use format gt-witness-<rig> but categorizeSession was
parsing them as gt-<rig>-<type>, incorrectly setting Rig="witness".
This caused the mayor status line to count "witness" as a third rig.

Added special case to handle gt-witness-<rig> format before the generic
rig-level parsing. Also updated tests to cover both actual and legacy formats.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 23:07:52 -08:00
Steve Yegge
53d9d7349d fix(polecat): Remove git push instruction - use merge queue instead
Polecats should not push their branches to origin directly.
They submit work via `gt done` which goes through the merge queue.
The Refinery handles merging to main.

This was causing stale polecat branches to accumulate on origin.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 23:07:03 -08:00
Steve Yegge
0e942c71f2 Add cross-project dependency design and update molecules doc (gt-hbg5)
New design for tracking dependencies across project boundaries:
- Capability-based: reference provides:X labels, not issue IDs
- bd ship command for publishing capabilities
- external: prefix in blocked_by for cross-project refs
- Molecule parking for blocked work

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 22:41:07 -08:00
Steve Yegge
33288cef3c bd sync: 2025-12-21 22:40:56 2025-12-21 22:40:56 -08:00
Steve Yegge
12e3fa01a4 bd sync: 2025-12-21 22:20:17 2025-12-21 22:20:17 -08:00
Steve Yegge
61d1973c6d bd sync: 2025-12-21 22:18:15 2025-12-21 22:18:15 -08:00
Steve Yegge
2a8ae43041 refactor(refinery): use io.Writer instead of fmt.Print for output
Add output field (io.Writer) to Manager and Engineer structs with
SetOutput() methods to enable testability and output redirection.

Replace all 30+ fmt.Printf/Println calls with fmt.Fprintf/Fprintln
using the configurable output writer, defaulting to os.Stdout.

This enables:
- Testing output without capturing stdout
- Redirecting output in different contexts
- Following cobra best practices

Closes: gt-cvfg

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 22:18:10 -08:00
Steve Yegge
b31e8bc72c bd sync: 2025-12-21 22:13:25 2025-12-21 22:13:25 -08:00
Steve Yegge
db3fee8088 refactor: add constants package for magic strings
Create internal/constants/constants.go with centralized definitions for:
- Directory names (mayor, polecats, crew, etc.)
- File names (rigs.json, town.json, state.json)
- Git branch names (main, beads-sync)
- Tmux session names (gt-mayor, gt-deacon)
- Agent role names

Add helper functions for common path construction:
- MayorRigsPath(), MayorTownPath(), MayorStatePath()
- RigMayorPath(), RigBeadsPath(), RigPolecatsPath()

Update key files to use the new constants:
- internal/cmd/rig_helpers.go
- internal/cmd/status.go
- internal/daemon/daemon.go

Closes: gt-xnql

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 22:13:21 -08:00
Steve Yegge
8979d8112b bd sync: 2025-12-21 22:07:42 2025-12-21 22:07:42 -08:00
Steve Yegge
7234a4847c bd sync: 2025-12-21 21:59:54 2025-12-21 22:00:02 -08:00
Steve Yegge
bc334502cf Simplify spawn.go to use bd mol run for molecules (gt-47tq)
Replace 95 lines of custom molecule instantiation with bd mol run:
- No more ephemeral beads layer
- No more manual molecule template handling
- bd mol run handles spawning, assignment, and pinning

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 22:00:02 -08:00
Steve Yegge
b8e8237dbc bd sync: 2025-12-21 21:58:53 2025-12-21 22:00:02 -08:00
Steve Yegge
43dfd768b6 bd sync: 2025-12-21 21:57:29 2025-12-21 22:00:02 -08:00
Steve Yegge
eb92b63847 bd sync: 2025-12-21 21:55:53 2025-12-21 22:00:02 -08:00
Steve Yegge
2315c5341c feat(witness): implement epic child filtering for auto-spawn
Add isChildOfEpic() function that checks if an issue is a child of
the configured epic by verifying the issue has the epic in its
dependents with dependency_type="blocks".

When EpicID is configured in witness config, only issues that block
that epic will be considered for auto-spawning. Issues that cannot
be verified are safely skipped.

Closes gt-zhm5.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:55:48 -08:00
Steve Yegge
89d6722e44 chore(style): remove unused helper functions
Remove RenderSuccess, RenderWarning, RenderError, and RenderInfo
functions that were never used. The codebase uses style.SuccessPrefix
and style.Success.Render() directly instead.

Closes gt-nz6t.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:51:02 -08:00
Steve Yegge
5a1b5e6d62 bd sync: 2025-12-21 21:50:57 2025-12-21 21:50:57 -08:00
Steve Yegge
f80d17b524 bd sync: 2025-12-21 21:50:37 2025-12-21 21:50:37 -08:00
Steve Yegge
fbd9c8ec47 bd sync: 2025-12-21 21:49:16 2025-12-21 21:49:27 -08:00
Steve Yegge
45ccce0f2b 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-21 21:49:07 -08:00
Steve Yegge
887e2f25e4 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-21 21:46:10 -08:00
Steve Yegge
9f5565e8b0 bd sync: 2025-12-21 21:45:59 2025-12-21 21:45:59 -08:00
Steve Yegge
72081b3336 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-21 21:41:39 -08:00
Steve Yegge
fea0fe6900 bd sync: 2025-12-21 21:37:51 2025-12-21 21:37:51 -08:00