Commit Graph

49 Commits

Author SHA1 Message Date
gastown/polecats/cheedo
12543d1450 fix: Make ParseAgentBeadID accept any valid prefix (gt-w0fqg)
Agent bead ID validation was hardcoded to only accept "gt-" prefix, which
caused errors when spawning beads polecats (which use "bd-" prefix):

  Error: invalid agent ID: agent ID must start with 'gt-' (got "bd-beads-polecat-pearl")

Changed ParseAgentBeadID to accept any 2-3 character prefix (gt-, bd-, hq-)
instead of hardcoding "gt-". Updated tests to cover other prefixes.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 22:25:18 -08:00
gastown/crew/max
b4a7b930e5 Update all prompts to use gt hook instead of gt mol status
- Role templates (crew, polecat, mayor, deacon, witness, refinery)
- prime.go startup protocol messages
- Documentation (propulsion, reference, molecules, wisp architecture)
- Session hints and sling prompts
- Formula template instructions
- CLAUDE.md

The hook is the user-facing concept, molecules are implementation details.
Agents should use `gt hook` to check what work is assigned to them.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 22:10:08 -08:00
Steve Yegge
8c80ad0aff Fix agent bead ID prefix - always use gt- not rig prefix
Agent beads must use gt- prefix (required by beads validation).
Only issue beads use rig-specific prefixes (ga-, bd-, etc.).

Fixed in:
- crew_add.go: Use CrewBeadID() not CrewBeadIDWithPrefix()
- prime.go: Use non-prefix variants for all agent types
- sling.go: Use non-prefix variants for all agent types

This fixes 'invalid agent ID' error when creating crew in rigs
with non-gt prefix (e.g., gastown with ga- prefix).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 19:12:39 -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
7fdee48807 Add gt sling support for deacon/dogs target (gt-0x5og.3)
Extends gt sling to dispatch work to dogs (Deacon helper workers):
- gt sling <work> deacon/dogs - Auto-dispatch to idle dog from pool
- gt sling <work> deacon/dogs/alpha - Dispatch to specific dog
- Pool management: --create flag to spawn dogs if pool is empty
- Dog state tracking (marks dog as working on dispatch)

New functions:
- IsDogTarget: Detect dog target patterns
- DispatchToDog: Find/spawn dog and prepare for work
- generateDogName: Create unique names for new dogs

Dogs are reusable workers for infrastructure tasks.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 10:53:40 -08:00
Steve Yegge
16076913ae fix: use rig-specific prefix for agent bead IDs (bd-otyh)
When spawning polecats in non-gastown rigs like beads, the agent bead ID
was incorrectly using the hardcoded "gt-" prefix instead of the rig's
configured prefix (e.g., "bd-" for beads).

Changes:
- Add GetPrefixForRig() in routes.go to look up prefix from routes.jsonl
- Update agentIDToBeadID() in sling.go to use rig's prefix via the new
  *WithPrefix functions instead of hardcoded "gt"
- Add unit tests for the new functionality

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 01:02:23 -08:00
Steve Yegge
2844edb541 Instrument gt commands to appear in activity feed (gt-7aw1m)
Phase 1 of activity feed improvements: gt commands now log events to
~/gt/.events.jsonl. This is the raw audit log that the feed daemon
(phase 2) will curate into the user-facing feed.

Instrumented commands:
- gt sling: logs sling events with bead and target
- gt hook: logs hook events with bead
- gt handoff: logs handoff events with subject
- gt done: logs done events with bead and branch
- gt mail send: logs mail events with to and subject

Event format follows the specification:
```json
{"ts":"2025-12-30T07:36:28Z","source":"gt","type":"mail",
 "actor":"gastown/crew/joe","payload":{...},"visibility":"feed"}
```

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:37:50 -08:00
Steve Yegge
91236ea268 feat: Add polecat workflow quality levels (basic/shiny/chrome)
Three pre-baked polecat workflows with increasing rigor:
- mol-polecat-basic: 3 steps, for trivial P4 fixes
- mol-polecat-shiny: 6 steps, standard quality with design/review
- mol-polecat-chrome: 16 steps, max rigor with strategic context reading,
  triple code review, and decomposed implementation phases

Added --quality (-q) flag to gt sling as shorthand:
  gt sling gt-abc gastown -q basic   # quick fix
  gt sling gt-abc gastown -q shiny   # standard
  gt sling gt-abc gastown -q chrome  # max rigor

Chrome explicitly requires reading ~/gt/docs/hop/CONTEXT.md and
~/gt/docs/PRIMING.md before design begins.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 23:19:32 -08:00
Steve Yegge
e2e25930c3 feat: Implement formula-on-bead mode in gt sling
When using `gt sling <formula> --on <bead>`, the command now properly
instantiates the formula as a molecule and bonds it to the target bead:

1. Cook the formula (ensures proto exists)
2. Create wisp with feature variable from bead title
3. Bond wisp to original bead (creates compound)
4. Hook the compound root (not bare bead) to target agent

This enables the "shiny" workflow (design→implement→review→test→submit)
to be applied to existing bugs/features, ensuring polecats complete all
phases including the code review step.

Example:
  gt sling shiny --on gt-abc gastown
  # Creates shiny molecule, bonds to gt-abc, slings compound to polecat

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:46:18 -08:00
Steve Yegge
196c3bbf9b Fix gt sling --naked to bypass pane lookup for terminated polecats
When slinging to an existing polecat with --naked flag, the code was still
attempting to look up the tmux pane, which fails for terminated polecats.
Now resolveTargetAgent accepts a skipPane parameter that bypasses the tmux
pane and working directory lookup when true.

This allows work to be slung to terminated polecats that will be restarted
manually later.

Also updated unsling to skip pane lookup since it only needs the agent ID.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 22:08:31 -08:00
Steve Yegge
c92b11d1bd feat: Standardize agent bead naming to prefix-rig-role-name (gt-zvte2)
Implements canonical naming convention for agent bead IDs:
- Town-level: gt-mayor, gt-deacon (unchanged)
- Rig-level: gt-<rig>-witness, gt-<rig>-refinery (was gt-witness-<rig>)
- Named: gt-<rig>-crew-<name>, gt-<rig>-polecat-<name> (was gt-crew-<rig>-<name>)

Changes:
- Added AgentBeadID helper functions to internal/beads/beads.go
- Updated all ID generation call sites to use helpers
- Fixed session parsing in theme.go, statusline.go, agents.go
- Updated doctor check and fix to use canonical format
- Updated tests for new format

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 14:54:37 -08:00
Steve Yegge
608d56937e feat: gt sling uses status=hooked and wakes witness+refinery (gt-fbz1z, gt-arjlu) 2025-12-29 12:49:24 -08:00
Steve Yegge
fa79d06d0e Add AgentIdentity type for session name parsing (gt-ov2uv)
Create AgentIdentity type to parse and construct session names, replacing
duplicated logic in sling.go and handoff.go.

- Add internal/session/identity.go with AgentIdentity type
- ParseSessionName handles: mayor, deacon, witness, refinery, crew, polecat
- SessionName() reconstructs valid tmux session name
- Address() returns mail-style address (e.g., "gastown/crew/max")
- GTRole() returns GT_ROLE env var format
- Update sling.go:sessionToAgentID to use ParseSessionName
- Update handoff.go:sessionToGTRole to use ParseSessionName
- Add comprehensive unit tests with round-trip verification

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 16:23:15 -08:00
Steve Yegge
34ccd121e8 feat: Complete agent bead lifecycle for ZFC compliance
Changes:
1. prime.go: Create agent beads on first prime for all roles including crew
2. done.go: Update agent state to done/stuck/idle when work completes
3. sling.go: Populate hook_bead when work is assigned to agents
4. mol-witness-patrol.formula.toml: Document dead and spawning states

Closes: gt-hymm0, gt-0lop3, gt-59k2x, gt-c4j4j

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 09:56:59 -08:00
Steve Yegge
2788996e74 Revert "Fix gt sling/hook: use Town beads for town-level roles (gt-4ol8f)"
This reverts commit ed9816015d.
2025-12-27 17:51:52 -08:00
Steve Yegge
ed9816015d Fix gt sling/hook: use Town beads for town-level roles (gt-4ol8f)
When slinging or hooking work to mayor/deacon, the pin now lands in Town
beads (~/.beads/) instead of rig beads. This ensures gt mol status finds
the pinned work when run from ~/gt.

The issue was that town-level roles operate from the town root, so their
hooks should be discoverable from there.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 17:46:43 -08:00
Steve Yegge
a2306fc928 revert: Keep bd wisp/pour until v0.38.0 - API not released yet
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 01:02:52 -08:00
Steve Yegge
4a04febf05 Revert "feat(sling): auto-pour protos when --var provided"
This reverts commit af77b109d1.
2025-12-27 00:37:49 -08:00
Steve Yegge
af77b109d1 feat(sling): auto-pour protos when --var provided
When slinging a bead that has the template label (a proto), and --var
flags are provided, automatically call bd --no-daemon pour to
instantiate the proto with variable substitution before slinging.

This enables the seamless workflow:
  gt sling mol-release beads --var version=0.38.0

Instead of the manual two-step:
  bd --no-daemon pour mol-release --var version=0.38.0 --json
  gt sling <resulting-mol-id> beads

Also adds a warning when slinging a proto without --var, since
{{variables}} will not be substituted.

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 00:34:12 -08:00
Steve Yegge
5d774b7d14 fix: Update remaining bd wisp calls to bd mol wisp
Missed patrol_helpers.go and sling.go in initial refactor.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 23:51:30 -08:00
Steve Yegge
b15c7173d4 chore: Drop JSON formula support, TOML only (gt-spt8v)
- Delete all .formula.json files (TOML versions exist)
- Update sling.go comment to say TOML only

Note: Doc updates were prepared but those docs were deleted
upstream in the recent refactoring.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 23:46:47 -08:00
Steve Yegge
4131638b5a fix: Prevent accidental re-sling of pinned beads
Add guard that checks if bead is already pinned before slinging.
Shows current assignee and requires --force to override.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 18:45:32 -08:00
Steve Yegge
0ad427e4a8 feat: Remove gt spawn completely - gt sling is THE command (gt-1py3y)
Fully remove gt spawn from the codebase:

- Delete spawn.go, create polecat_spawn.go with just sling helpers
- Remove all gt spawn references from docs and CLAUDE.md
- Update code comments to reference gt sling

gt sling now handles ALL work dispatch:
- Existing agents: gt sling <bead> mayor/crew/witness
- Auto-spawn: gt sling <bead> <rig>
- No-tmux: gt sling <bead> <rig> --naked
- With args: gt sling <bead> --args "..."

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 18:36:03 -08:00
Steve Yegge
6de8f80ea9 feat: Unify gt sling and gt spawn - sling is THE work dispatch command (gt-1py3y)
Complete unification of work assignment commands:

- Add spawn flags to sling: --naked, --create, --molecule, --force, --account
- SpawnPolecatForSling now accepts SlingSpawnOptions struct
- Deprecate gt spawn with warning pointing to gt sling
- Update no-tmux-mode.md to use sling examples

gt sling now handles:
- Existing agents (mayor, crew, witness, refinery)
- Auto-spawning polecats when target is a rig
- Formula instantiation and wisp creation
- No-tmux mode for manual agent operation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 18:19:14 -08:00
Steve Yegge
9462208f79 feat: Implement no-tmux mode with beads as data plane (gt-vc3l4)
Enable Gas Town to operate without tmux by using beads for args transport:

- Add `attached_args` field to beads AttachmentFields
- gt sling: Store args in bead description, graceful fallback if no tmux
- gt prime: Display attached args prominently on startup
- gt mol status: Include attached_args in status output
- gt spawn --naked: Assign work via mail only, skip tmux session

Agents discover args via gt prime / bd show when starting manually.
Docs added explaining what works vs degraded behavior in no-tmux mode.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 18:04:57 -08:00
Steve Yegge
1659a92309 docs: Update sling help text to reflect pinned beads (not hook files)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 17:05:53 -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
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
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
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
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
f86a73c2f0 feat: Add gcloud-style command grouping to gt help output
Organize 43 commands into 7 logical groups using cobra's built-in
AddGroup/GroupID feature:

- Work Management: spawn, sling, hook, handoff, done, mol, mq, etc.
- Agent Management: mayor, witness, refinery, deacon, polecat, etc.
- Communication: mail, nudge, broadcast, peek
- Services: daemon, start, stop, up, down, shutdown
- Workspace: rig, crew, init, install, git-init, namepool
- Configuration: account, theme, hooks, issue, completion
- Diagnostics: status, doctor, prime, version, help

Also renamed molecule to mol as the primary command name
(molecule is now an alias).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 02:32:01 -08:00
Steve Yegge
2f8bc581a6 Add --on flag to gt sling for formula scaffolding (gt-8tmz.9)
When --on is specified, the first argument is a formula name:
  gt sling shiny --on gt-abc123

This applies the formula to existing work, creating wisp scaffolding
that shapes execution of the target bead.

Changes:
- Add Formula field to SlungWork wisp type
- Add --on flag to gt sling command
- Verify both bead and formula exist before slinging
- Update dry-run output to show formula info

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 02:00:52 -08:00
Steve Yegge
9f9ed1b928 Improve autonomous work mode and fix hook storage (gt-1xsah)
- gt prime: New AUTONOMOUS WORK MODE prompt with clear DO/DON'T instructions
- gt prime: Skip normal startup directive when in autonomous mode
- gt prime: Search multiple beads locations for Mayor's beads
- gt sling: Use GetRole() for role detection instead of cwd
- gt sling: Store hooks in role's home directory, not git root

This ensures hooks work correctly regardless of where commands are run from.
Mayor's hooks always go to ~/gt/.beads/ even when running from a rig dir.
2025-12-25 01:21:12 -08:00
Steve Yegge
23600af50c docs: comprehensive hook/sling/handoff/nudge audit
- Update propulsion-principle.md: implementation status now accurate
- Update beads-data-plane.md: correct command syntax
- Fix hook.go: clarify durability semantics, add related commands
- Fix sling.go: use reliable NudgePane instead of raw tmux send-keys
- Add tmux.NudgePane: pane-targeted reliable message delivery

The command menagerie:
  gt hook    = assign (durability)
  gt nudge   = communicate (generic messaging)
  gt sling   = hook + nudge "start working"
  gt handoff = hook + restart (GUPP kicks in)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 21:17:25 -08:00
Steve Yegge
57179c1e33 fix: gt sling now hooks + runs (no restart), update docs
Corrected sling behavior:
- gt hook: attach only (durability primitive)
- gt sling: attach + inject run prompt (preserve context)
- gt handoff: attach + restart (fresh context via GUPP)

Sling can now target other agents: gt sling <bead> <target>

Updated docs/sling-design.md with full command menagerie.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 21:04:24 -08:00
Steve Yegge
32cac078e5 refactor: split gt sling into gt hook + gt handoff <bead> (gt-z4bw)
- Add gt hook <bead>: durability primitive, attaches work to hook
- Update gt handoff: accept optional bead arg (detects bead vs role)
- Deprecate gt sling: shows warning, points to new commands
- Update doctor fix hint to reference new commands

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 20:41:51 -08:00
Steve Yegge
7c7b8b551d fix: critical issues in wisp hook system
Code review fixes:

1. CRITICAL: Move polecat check to start of runSling
   - Previously wrote wisp THEN failed, leaving orphan
   - Now fails fast before any file operations

2. CRITICAL: Sanitize slashes in agent IDs for filenames
   - Agent IDs like 'gastown/crew/joe' were creating subdirs
   - Now converts '/' to '--' for safe filenames
   - Added sanitizeAgentID/unsanitizeAgentID helpers

3. MODERATE: Use git root instead of WorkDir in prime.go
   - Hooks are written to clone root, not cwd
   - Added getGitRoot() helper for consistency

4. MODERATE: Fix silent error swallowing
   - Now logs non-ErrNoHook errors when reading hooks
   - Warns if bead doesn't exist before burning hook
   - Preserves hook if bead is missing for debugging
2025-12-24 16:20:04 -08:00
Steve Yegge
b2f1b58f13 feat: implement gt sling and wisp hook system (gt-qvn7.1)
Phase 1 of tracer bullet: Slinging Handoff

- Add internal/wisp package for ephemeral work attachment
- Add gt sling command to attach work and restart
- Update gt prime to check/burn slung work on hook
- Add .beads-wisp/ to gitignore
2025-12-24 16:08:15 -08:00
Steve Yegge
c10709dc3f terminology: spawn → pour/wisp for molecules (gt-9uy0)
Molecules use chemistry verbs, not spawn:
- pour = create persistent mol (liquid)
- wisp = create ephemeral wisp (vapor)
- spawn = polecats only (workers)

Changes:
- Delete chemistry-design-changes.md (migration doc)
- Remove migration tables from sling-design.md
- Update bond tables: Spawn → Pour/Wisp
- Rename spawnMoleculeFromProto → pourMoleculeFromProto
- Rename spawnMoleculeOnIssue → runMoleculeOnIssue
- Update templates: bd mol spawn → bd wisp
- Update prime.go: commands and messages
- Clean all docs and comments

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 14:04:19 -08:00
Steve Yegge
475dcb37fa gt sling: enable wisp spawning for patrol roles (gt-jsup)
Revert IsWisp: false → true for patrol spawning. bd mol run now
auto-discovers the main database for templates when --db contains
.beads-wisp, so patrol molecules can spawn correctly into ephemeral storage.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 16:39:46 -08:00
Steve Yegge
58c0fae614 gt sling: use mail queue for patrol roles (gt-afn0)
When slinging work to patrol agents (witness, refinery, deacon), queue via
mail instead of replacing the hook. This preserves patrol continuity.

New behavior:
- Default: Check if patrol is running, start default patrol if not, send
  work via mail. Patrol processes queued work during its cycle.
- --urgent: Marks mail as urgent (🚨 URGENT prefix)
- --replace: Legacy behavior, explicitly terminates patrol (break-glass)

New helper functions:
- isPatrolRole(kind): Returns true for witness/refinery/deacon
- getDefaultPatrolMolecule(role): Returns patrol template name
- resolvePatrolMoleculeID(path, title): Looks up beads issue ID by title
- isPatrolRunning(path, addr): Checks if patrol molecule is attached

Note: Patrol spawning currently uses main DB (not wisp storage) because
templates must be looked up from the main database. Wisp support for
patrol instances is a future enhancement.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 16:24:55 -08:00
Steve Yegge
7f37d41da3 gt sling --force: return displaced work to ready pool (gt-o40t)
When slinging with --force to an agent with occupied hook, the displaced
molecule is now returned to the ready pool rather than silently orphaned.

Changes:
- Modified checkHookCollision to take force param and return displaced ID
- Added releaseDisplacedWork helper to unpin and release displaced molecules
- Updated all 5 sling handlers (polecat, crew, witness, refinery, mayor)

Behavior:
- Without --force: still errors "hook already occupied by X"
- With --force: prints warning, releases old work, proceeds with new sling

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 16:07:42 -08:00
Steve Yegge
84aa69207a fix: add Pin/Unpin methods and call bd pin in pinToHook (gt-o3is)
Adds Pin() and Unpin() methods to the beads wrapper that call bd pin/unpin.

Updates pinToHook() to call b.Pin() after AttachMolecule() to set the
pinned boolean field and assignee on the work issue. This should enable
bd hook to show pinned work.

NOTE: There's a known issue where bd pin via subprocess doesn't actually
set the pinned field even though it reports success. The handoff bead
attachment remains the primary mechanism until this is resolved.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 04:51:17 -08:00
Steve Yegge
84c7d48ef4 feat: add crew, witness, refinery, mayor as sling targets
Adds support for slinging work to four new target types:

- crew (e.g., beads/crew/dave): Human-managed persistent workers
  - No worktree recreation
  - No auto-session start
  - Sends work assignment mail

- witness (e.g., gastown/witness): Per-rig lifecycle manager
  - Suggests --wisp for ephemeral work
  - Pins to witness hook

- refinery (e.g., gastown/refinery): Per-rig merge queue
  - Accepts protos, issues, and epics
  - Pins to refinery hook

- mayor (e.g., mayor/): Town-level coordinator
  - Uses town-level beads
  - Human-managed like crew
  - Sends work assignment mail

Updated help text with new target formats and examples.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 04:37:29 -08:00
Steve Yegge
5732218da3 Clean up redundant 'ephemeral' terminology in wisp docs (gt-3x0z.11)
Remove redundant phrases like 'ephemeral wisp' and 'ephemeral molecule'
since wisp already implies ephemeral. Keep 'ephemeral' only where it is
definitional (explaining what wisps are) or contrasting (vs durable mol).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 21:43:27 -08:00
Steve Yegge
df0495be32 feat(tui): add self-documenting help with ASCII diagrams and table helpers
TUI improvements for Christmas launch:
- Add phase transition table and lifecycle diagram to `gt molecule --help`
- Add swarm lifecycle diagram to `gt swarm --help`
- Add mail routing diagram to `gt mail --help`
- Add sling mechanics diagram to `gt sling --help`
- Create Lipgloss table helper (internal/style/table.go)
- Migrate mq_list to use styled tables with color-coded priorities
- Migrate molecule list to use styled tables
- Add fuzzy matching "did you mean" suggestions for polecat not found errors
- Add suggest package with Levenshtein distance implementation

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 17:52:44 -08:00
Steve Yegge
58ff4c1750 Add gt mol catalog/burn/squash, wire wisp flag, update deacon prompt
- gt mol catalog: list available molecule protos
- gt mol burn: burn current molecule without digest
- gt mol squash: compress molecule into digest
- Wire --wisp flag in gt sling to use .beads-wisp/ storage
- Add IsWisp field to MoleculeContext
- Update prompts/roles/deacon.md with correct commands

Closes: gt-x74c, gt-9t14, gt-i4i2

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 13:20:29 -08:00
Steve Yegge
982b7cb5ed Implement gt sling command (gt-4ev4)
The unified work dispatch command that implements spawn + assign + pin
in one operation, based on the Universal Gas Town Propulsion Principle:
"If you find something on your hook, YOU RUN IT."

Supports:
- Proto names (e.g., gt sling feature polecat/alpha)
- Issue IDs with optional molecule (e.g., gt sling gt-xyz polecat/beta -m bugfix)
- Target addressing (polecat/name, deacon/, witness/, refinery/)
- --wisp flag for ephemeral molecules
- --force flag for hook collision override
- Hook collision detection

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 13:02:33 -08:00