Commit Graph

1864 Commits

Author SHA1 Message Date
Steve Yegge
4d3a689d41 Add gt worktree list command (gt-xheo6.2)
Implements `gt worktree list` to show all cross-rig worktrees owned
by the current crew member. Scans all rigs and shows git status
summary for each worktree found.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:29:06 -08:00
Steve Yegge
a5fa5602b5 bd sync: 2025-12-30 18:26:49 2025-12-30 18:26:49 -08:00
Steve Yegge
bbbb527708 Add Landing Rule to crew and polecat templates
Work is NOT landed until it's either on main or in the Refinery MQ.
Feature branches are dangerous in multi-agent environments - the repo
baseline can diverge wildly in hours.
2025-12-30 18:21:39 -08:00
Steve Yegge
23fca6f2eb Add Landing Rule to polecat priming: work must be on main or in MQ 2025-12-30 18:19:09 -08:00
Steve Yegge
edffa606aa bd sync: 2025-12-30 18:17:35 2025-12-30 18:17:35 -08:00
Steve Yegge
3a55bb43ab bd sync: 2025-12-30 18:10:11 2025-12-30 18:10:21 -08:00
Steve Yegge
cbcf9ec051 bd sync: 2025-12-30 18:05:22 2025-12-30 18:10:21 -08:00
Steve Yegge
941853b503 bd sync: 2025-12-30 18:03:25 2025-12-30 18:10:21 -08:00
Steve Yegge
e0b6be0eaf Document cross-rig worktree pattern (gt-xheo6.4)
Add documentation for crew workers using cross-rig worktrees:
- Added Cross-Rig Worktrees section to crew.md.tmpl template
- Created docs/understanding-gas-town.md with role taxonomy

Key points documented:
- Crew vs Dogs distinction (dogs = Deacon infra, not user work)
- Identity preservation across rigs (BD_ACTOR stays the same)
- When to use worktrees vs dispatch to local workers
- Directory structure convention: ~/gt/<rig>/crew/<source-rig>-<name>/

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:05:30 -08:00
Steve Yegge
91fa5e63dc Replace 'gastown' with 'greenplace' in user-facing docs/examples
Using "greenplace" (The Green Place from Mad Max: Fury Road) as the
canonical example project/rig name in documentation and help text.
This provides a clearer distinction from the actual gastown repo name.

Changes:
- docs/*.md: Updated all example paths and commands
- internal/cmd/*.go: Updated help text examples
- internal/templates/: Updated example references
- Tests: Updated to use greenplace in example session names

Note: Import paths (github.com/steveyegge/gastown) and actual code
paths referencing the gastown repo structure are unchanged.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:03:06 -08:00
Steve Yegge
708cdb2b24 Add gt worktree command for cross-rig work (gt-xheo6.1)
Implements the gt worktree <rig> command that allows crew workers to
create worktrees in other rigs for cross-rig work while maintaining
their identity.

Features:
- Detects crew identity from cwd (requires crew/ directory)
- Creates worktree at <target-rig>/crew/<source-rig>-<name>/
- Sets up git config for identity preservation
- Handles edge cases: already exists, rig not found, wrong role

Usage: gt worktree beads (from gastown/crew/joe → beads/crew/gastown-joe/)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:02:59 -08:00
Steve Yegge
b728b1a25a bd sync: 2025-12-30 18:02:43 2025-12-30 18:02:43 -08:00
Steve Yegge
fd2f4ca944 bd sync: 2025-12-30 18:01:54 2025-12-30 18:02:13 -08:00
Steve Yegge
a834bc79d4 Document BD_ACTOR format convention (gt-6r18e.9)
Add docs/identity.md with canonical BD_ACTOR format:
- Town level: mayor, deacon
- Rig level: {rig}/witness, {rig}/refinery
- Workers: {rig}/crew/{name}, {rig}/polecats/{name}

Also documents the attribution model:
- GIT_AUTHOR_NAME = BD_ACTOR (agent identity)
- GIT_AUTHOR_EMAIL = overseer email (work owner)
- created_by = BD_ACTOR (beads field)

Updates reference.md with expanded environment variables section
and adds cross-reference from federation.md.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:02:04 -08:00
Steve Yegge
66042da18b Add session beacon for predecessor discovery via /resume
Inject an identity beacon as the first message when Gas Town starts Claude
sessions. This beacon becomes the session title in Claude Code '/resume
picker, enabling workers to find their predecessor sessions for debugging.

Beacon format: [GAS TOWN] <address> • <mol-id or "ready"> • <timestamp>

Examples:
- [GAS TOWN] gastown/crew/max • gt-abc12 • 2025-12-30T14:32
- [GAS TOWN] gastown/polecats/Toast • ready • 2025-12-30T09:15
- [GAS TOWN] deacon • patrol • 2025-12-30T08:00

Workers can now press / in /resume picker and search for their address
(e.g., "gastown/crew/max") to see all predecessor sessions.

Note: Respawn-loop agents (deacon/refinery via up.go) skip beacon injection
since Claude restarts multiple times - would need post-restart injection.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:01:47 -08:00
Steve Yegge
5c61c8c334 bd sync: 2025-12-30 17:41:02 2025-12-30 17:41:02 -08:00
Steve Yegge
05b1f30381 Fix agent bead prefix mismatch for rigs with custom prefixes (bd-otyh)
When spawning polecats in rigs with custom prefixes (e.g., beads uses bd-
instead of gt-), agent beads were being created with hardcoded gt- prefix,
causing warnings like issue ID gt-beads-polecat-obsidian does not match
configured prefix bd.

Changes:
- polecat/manager.go: agentBeadID() now looks up the rigs configured prefix
  from routes.jsonl via beads.GetPrefixForRig()
- prime.go: getAgentBeadID() now uses prefix lookup for rig-level agents
  (witness, refinery, polecat, crew)

Town-level agents (mayor, deacon) continue to use gt- prefix as expected.
2025-12-30 16:56:46 -08:00
Steve Yegge
8754acff7e bd sync: 2025-12-30 16:43:00 2025-12-30 16:56:46 -08:00
Steve Yegge
dc5f06e11c bd sync: 2025-12-30 16:42:49 2025-12-30 16:56:46 -08:00
Steve Yegge
be34002d96 Implement convoy --notify flag notification (gt-5tipl)
The --notify flag on gt convoy create was captured but never used.
This fix:

1. Stores the notify address in a bd slot when convoy is created
2. Adds 'gt convoy notify <convoy-id>' command that:
   - Reads the notify slot
   - Sends mail to the configured address with convoy completion details
   - Does nothing gracefully if no notification was configured

The convoy-cleanup formula can now call 'gt convoy notify {{convoy}}'
to trigger the configured notification when a convoy completes.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 16:52:37 -08:00
Steve Yegge
eea821bd62 Add polecat session cycling (C-b n/p)
Polecats for a rig now cycle among themselves, like crew members.
Session groups are now:
- Town: Mayor ↔ Deacon
- Crew: All crew in same rig
- Rig infra: Witness ↔ Refinery
- Polecats: All polecats in same rig

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 16:47:28 -08:00
Steve Yegge
38fe3cbd32 Add gt audit command for provenance queries (gt-6r18e.8)
New command that queries work history across multiple sources:
- Git commits authored by an actor
- Beads created/closed by an actor
- Town log events (spawn, done, handoff, etc.)
- Activity feed events

Supports --actor for filtering, --since for time range, --json for
machine-readable output, and -n/--limit for result count.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 16:43:39 -08:00
Steve Yegge
09120b1012 Add BD_ACTOR env var default for created_by field enforcement (gt-6r18e.6)
- Create() function now defaults Actor from BD_ACTOR env var when not provided
- CreateAgentBead() now passes --actor flag from BD_ACTOR for provenance tracking
- This ensures created_by is populated on all issue creation paths

Affects: merge requests, escalations, digests, agent beads, molecule steps

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 16:42:14 -08:00
Steve Yegge
1812ffa430 Add delegation relationship type to beads (gt-6r18e.5)
Add Delegation and DelegationTerms structs for tracking work delegation
between work units. This enables the HOP pattern of work flowing down
and credit cascading up.

New types:
- Delegation: Links parent and child work units with delegated_by/to
- DelegationTerms: Optional terms including portion, deadline, credit_share

New functions:
- AddDelegation: Create a delegation relationship
- RemoveDelegation: Remove a delegation relationship
- GetDelegation: Retrieve delegation info for a child work unit
- ListDelegationsFrom: List all delegations from a parent

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 16:29:02 -08:00
Steve Yegge
020784a70d Update federation.md URI scheme to use hop:// (gt-6r18e.4)
- Changed gt:// to hop:// for HOP protocol URIs
- Added beads:// scheme for cross-repo references
- Documented local short forms (prefix routing)
- Updated implementation status

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 16:24:08 -08:00
Steve Yegge
4d4f23eb18 Add Owner and PublicName fields to TownConfig (gt-6r18e.3)
Adds federation identity fields to town.json:
- Owner: email address for entity identity (defaults to git user.email)
- PublicName: public display name (defaults to town name)

Schema version bumped to 2. Existing town.json files remain compatible
as new fields are optional.

Also adds --owner and --public-name flags to 'gt install'.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 16:21:38 -08:00
Steve Yegge
2112804aba Implement Boot: daemon entry point dog for Deacon triage (gt-rwd5j)
Boot is a watchdog that the daemon pokes instead of Deacon directly,
centralizing the 'when to wake Deacon' decision in an agent that can
reason about context.

Key changes:
- Add internal/boot package with marker file and status tracking
- Add gt boot commands: status, spawn, triage
- Add mol-boot-triage formula for Boot's triage cycle
- Modify daemon to call ensureBootRunning instead of ensureDeaconRunning
- Add tmux.IsAvailable() for degraded mode detection
- Add boot.md.tmpl role template

Boot lifecycle:
1. Daemon tick spawns Boot (fresh each time)
2. Boot runs triage: observe, decide, act
3. Boot cleans stale handoffs from Deacon inbox
4. Boot exits (or handoffs in non-degraded mode)

In degraded mode (no tmux), Boot runs mechanical triage directly.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 16:20:00 -08:00
Steve Yegge
3099d99424 Set GIT_AUTHOR_NAME per agent session (gt-6r18e.1)
Export GIT_AUTHOR_NAME alongside BD_ACTOR in all agent session startup
locations. This enables git log --author queries for agent work while
keeping GIT_AUTHOR_EMAIL as the workspace owner.

Files updated:
- internal/session/manager.go (polecat sessions)
- internal/daemon/daemon.go (deacon, witness, polecat via daemon)
- internal/daemon/lifecycle.go (polecat lifecycle)
- internal/cmd/*.go (crew, mayor, deacon, witness, refinery, up, handoff)
- internal/session/manager_test.go (updated test expectations)
- docs/federation.md (marked feature as implemented)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 16:14:33 -08:00
Steve Yegge
78db2c768f Fix crew test expecting CLAUDE.md to be created
The test expected CLAUDE.md to be created by Add(), but the code
intentionally skips this (CLAUDE.md is injected via SessionStart
hook to avoid leaking Gas Town context into project repos).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:59:00 -08:00
Steve Yegge
cf70114592 docs: Add operational state design (Boot, events, degraded mode)
New doc covering:
- Events as state transitions (type: event beads)
- Labels-as-state pattern for fast queries
- Boot: daemon entry point dog for Deacon triage
- Degraded mode (no-tmux operation)

Related issues:
- gt-rwd5j: Implement Boot
- bd-ecmd: Add type: event
- bd-irah: Add refs field
- bd-31ae: Document labels-as-state

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:17:26 -08:00
Steve Yegge
9f165d7c82 Fix SQL injection vulnerability in convoy.go (gt-frvun)
Add input validation for convoyID before using it in SQL query.
Issue IDs must match ^[a-zA-Z0-9_-]+$ to prevent injection attacks.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 14:14:46 -08:00
Steve Yegge
d98daed901 Add gt convoy create/status/list commands (gt-frvun)
Implements CLI for convoy management in Gas Town:
- gt convoy create <name> [issues...] - Creates convoy in town beads (hq-* prefix)
- gt convoy status [id] - Shows convoy progress and tracked issues
- gt convoy list - Lists all convoys with optional status filter

Convoys track issues across rigs using the 'tracks' relation type
and auto-close when all tracked issues complete.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 13:58:07 -08:00
Steve Yegge
e383243161 bd sync: 2025-12-30 13:56:30 2025-12-30 13:56:30 -08:00
Steve Yegge
80cbada427 bd sync: 2025-12-30 13:43:48 2025-12-30 13:43:48 -08:00
Steve Yegge
6b9ba2362b bd sync: 2025-12-30 13:43:44 2025-12-30 13:43:44 -08:00
Steve Yegge
bb0d248f4d bd sync: 2025-12-30 13:33:39 2025-12-30 13:33:39 -08:00
Steve Yegge
31de4c81d3 bd sync: 2025-12-30 12:56:26 2025-12-30 12:56:26 -08:00
Steve Yegge
9ebc733623 fix: stop writing Gas Town context to polecat CLAUDE.md
Same fix as crew: polecat manager was overwriting project CLAUDE.md with
Gas Town polecat context. Gas Town context is now injected ephemerally via
SessionStart hook (gt prime) only.

Removed installCLAUDETemplate function and associated tests.
2025-12-30 12:01:27 -08:00
Steve Yegge
6c3e59d015 fix: stop writing Gas Town context to CLAUDE.md
gt crew add was overwriting project CLAUDE.md with Gas Town crew context.
This caused Gas Town internals to leak into project repos when workers
committed and pushed.

Gas Town context is now injected ephemerally via SessionStart hook (gt prime)
only, never written to tracked files.
2025-12-30 11:58:07 -08:00
Steve Yegge
7f94074de0 Add federation architecture doc (gt-6r18e) 2025-12-30 11:09:44 -08:00
Steve Yegge
0b331cbf64 bd sync: 2025-12-30 11:08:56 2025-12-30 11:09:07 -08:00
Steve Yegge
3c56f2c1dd Refactor Deacon patrol to detect→dispatch pattern (gt-0x5og.4)
Major changes to mol-deacon-patrol.formula.toml v4:
- Add DOG_DONE message handling in inbox-check step
- Add dog-pool-maintenance step for idle dog availability
- Change orphan-check to detect-only (dispatches to dogs via sling)
- Change session-gc to detect-only (dispatches to dogs via sling)

The Deacon now stays lightweight by detecting issues and dispatching
heavy work to dogs rather than executing inline. This prevents context
bloat and keeps patrol cycles fast.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 11:02:49 -08:00
Steve Yegge
f1b7b953b8 bd sync: 2025-12-30 11:01:44 2025-12-30 11:01:44 -08:00
Steve Yegge
f64cec2853 bd sync: 2025-12-30 10:53:30 2025-12-30 10:57:34 -08:00
Steve Yegge
d21dd0a0b0 bd sync: 2025-12-30 10:41:14 2025-12-30 10:57:34 -08:00
Steve Yegge
3dec0d0072 bd sync: 2025-12-30 10:41:05 2025-12-30 10:57:34 -08:00
Steve Yegge
75ee851813 bd sync: 2025-12-30 10:36:59 2025-12-30 10:57:34 -08:00
Steve Yegge
3fa1911f27 bd sync: 2025-12-30 10:36:11 2025-12-30 10:57:34 -08:00
Steve Yegge
4db2696a9f bd sync: 2025-12-30 10:35:50 2025-12-30 10:57:34 -08:00
Steve Yegge
5b28ba2e4b bd sync: 2025-12-30 10:34:05 2025-12-30 10:57:34 -08:00