Commit Graph

22 Commits

Author SHA1 Message Date
gastown/crew/max
5be4255f35 Improve gt mol help and add gt formulas command
- Rewrote gt mol help to focus on agent operations (YOUR hook, YOUR work)
- Removed misleading "use bd mol pour" guidance (gt sling handles this)
- Added gt formulas command as convenience wrapper for bd formula list
- Agents no longer need to know about bd for common workflow operations

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 22:02:45 -08:00
gastown/crew/joe
df46e75a51 Fix: Unknown subcommands now error instead of silently showing help
Parent commands (mol, mail, crew, polecat, etc.) previously showed help
and exited 0 for unknown subcommands like "gt mol foobar". This masked
errors in scripts and confused users.

Added requireSubcommand() helper to root.go and applied it to all parent
commands. Now unknown subcommands properly error with exit code 1.

Example before: gt mol unhook → shows help, exits 0
Example after:  gt mol unhook → "Error: unknown command "unhook"", exits 1

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 20:52:23 -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
3aeaeaf845 feat: gt mol attach auto-detects agent from cwd when single arg provided
When called with 1 arg from an agent working directory, gt mol attach
now auto-detects the pinned bead ID from the current agent's hook.

Uses the same role detection infrastructure as gt mail and bd. (gt-t7ekm)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 00:19:12 -08:00
Steve Yegge
888bc3ea74 refactor: Remove duplicate mol commands from gt (gt-w91xz)
Remove beads data operations from gt mol, delegating to bd:
- catalog → bd formula list
- list → bd mol list
- show → bd mol show
- parse → bd mol show
- instantiate → bd mol pour
- instances → bd queries
- bond → bd mol bond

Keep agent-specific operations:
- status, current, progress (agent context queries)
- attach, detach, attachment, attach-from-mail (hook management)
- step (agent step operations)
- burn, squash (agent-aware lifecycle)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:36:12 -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
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
e0a2187636 Remove deprecated builtin molecules infrastructure
- Delete builtin_molecules.go (empty stubs)
- Remove `mol export` command (exported 0 molecules)
- Clean dead code in catalog.go iterating empty BuiltinMolecules()
- Update docs to reference formula files instead of Go code

Molecules are now defined as .beads/formulas/*.formula.json files
and cooked into proto beads via `bd cook`.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 11:29:41 -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
7e568770de refactor: remove legacy .beads-wisp infrastructure (gt-5klh)
Wisps are now just a flag on regular beads issues (Wisp=true).
No separate directory needed - hooks stored in .beads/.

Changes:
- wisp package: WispDir now points to .beads/, removed PatrolCycle
- manager.go: removed initWispBeads() - no separate dir to create
- mrqueue.go: MRs stored in .beads/mq/ instead of .beads-wisp/mq/
- doctor: removed obsolete wisp directory checks
- docs: updated wisp-architecture.md to reflect simplified model

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 21:34:14 -08:00
Steve Yegge
031a27c062 feat: add WaitsFor parsing and mol bond command (gt-odfr, gt-isje)
WaitsFor parsing:
- Add WaitsFor []string field to MoleculeStep struct
- Parse WaitsFor lines in molecule descriptions
- Enables fanout gate semantics (e.g., WaitsFor: all-children)
- Case-insensitive parsing like Needs/Tier

mol bond command:
- Add gt mol bond for dynamic child molecule creation
- Supports --parent, --ref, and --var flags
- Enables Christmas Ornament pattern for parallel child execution
- Creates child issue with expanded template variables
- Instantiates proto steps under the bonded child

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 21:44:25 -08:00
Steve Yegge
00c64a075c feat: add gt mol attach-from-mail command (gt-h6eq.7)
Allows agents to self-pin work from mail messages. The command:
1. Reads a mail message by ID
2. Extracts molecule ID from the body (attached_molecule:, molecule_id:, etc.)
3. Attaches the molecule to the agent's pinned bead (hook)
4. Marks the mail as read

Includes unit tests for the molecule ID extraction logic.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:44:34 -08:00
Steve Yegge
78507ff326 refactor(cmd): split molecule.go into focused files
Split the 1929-line molecule.go into 5 focused files:
- molecule.go (376): command definitions, init(), loadMoleculeCatalog
- molecule_status.go (673): status, progress, current commands
- molecule_list.go (432): list, show, export, parse, instances
- molecule_lifecycle.go (359): instantiate, catalog, burn, squash
- molecule_attach.go (128): attach, detach, attachment

No functional changes - pure refactoring for maintainability.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 01:38:34 -08:00
Steve Yegge
2e5fcbc307 Add gt molecule current command (gt-ay1r)
Implements a new command to query what an agent should be working on:
- Finds handoff bead by agent identity
- Parses attached molecule and tracks progress through steps
- Identifies current/next step (in_progress or first ready)
- Reports status: working, naked, complete, or blocked

Usage:
  gt molecule current [identity]
  gt mol current gastown/furiosa
  gt mol current --json

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 23:52:35 -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
e1bbd81fb0 Implement gt mol status command (gt-uym5)
Add `gt mol status [target]` command to show what's on an agent's hook:
- Auto-detects current agent from working directory
- Shows pinned bead and attached molecule info
- Displays phase progress with progress bar
- Indicates wisp vs durable molecules
- Provides next action hints

Also adds `mol` alias for the `molecule` command.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 12:34:13 -08:00
Steve Yegge
2e59c002e8 feat(beads): add attachment fields for pinned beads (gt-rana.1)
Implement AttachmentFields to track molecule attachments on pinned/handoff beads:
- AttachedMolecule: root issue ID of attached molecule
- AttachedAt: timestamp when attached

API:
- AttachMolecule(pinnedBeadID, moleculeID) - attach
- DetachMolecule(pinnedBeadID) - detach
- GetAttachment(pinnedBeadID) - query
- ParseAttachmentFields(issue) - parse from description
- FormatAttachmentFields(fields) - format for description

Includes comprehensive tests for parsing and API.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 15:53:15 -08:00
Steve Yegge
308a7bc190 gt-975: Molecule execution support for polecats and crew
Added molecule workflow integration to Gas Town:

1. spawn.go: MoleculeContext in work assignment mail
   - Shows step N/M and molecule ID in subject
   - Includes molecule workflow instructions
   - Guides polecat through DAG execution

2. prime.go: outputMoleculeContext()
   - Detects if in-progress issue is a molecule step
   - Shows molecule progress and next steps
   - Displays molecule work loop instructions

3. molecule.go: 'gt molecule progress' command
   - Shows execution progress for molecule root
   - Displays done/in-progress/ready/blocked steps
   - Progress bar and completion percentage
   - JSON output for Witness automation

This enables polecats to work through molecule DAGs:
- Receive molecule-aware work assignments
- See context in gt prime output
- Follow DAG with 'bd ready --parent <root>'
- Witness can monitor with 'gt molecule progress'

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 12:03:21 -08:00
Steve Yegge
5f206348a5 fix: Use correct beads paths for molecule and statusline
- molecule.go: Use findLocalBeadsDir() for project-level beads
- statusline.go: Use findMailWorkDir() for mail count (town beads)

Part of two-level beads architecture cleanup.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 18:30:45 -08:00
Steve Yegge
2f5bbf5fdb feat(molecule): Add molecule catalog with hierarchical loading
Implement MoleculeCatalog for loading molecules from multiple sources:
1. Built-in molecules (shipped with the gt binary)
2. Town-level: <town>/.beads/molecules.jsonl
3. Rig-level: <rig>/.beads/molecules.jsonl
4. Project-level: .beads/molecules.jsonl

Changes:
- Add internal/beads/catalog.go with MoleculeCatalog type
- Update gt molecule list to show source (builtin, town, rig, project, database)
- Update gt molecule show to check catalog first, then database
- Update gt molecule instantiate to check catalog first
- Add gt molecule export command to export built-in molecules to JSONL
- Add --catalog and --db flags to gt molecule list

The catalog enables organizations to share molecule templates
independently of work item tracking, and allows customization
at different levels of the workspace hierarchy.

Closes gt-0ei3.

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 16:49:34 -08:00
Steve Yegge
4c064aff5d feat(molecule): add molecule CLI commands and spawn integration
Add `gt molecule` subcommands for managing workflow templates:
- list: Show all molecules (type=molecule issues)
- show: Display molecule with parsed step structure
- parse: Validate molecule and show parsed details
- instantiate: Create child beads from molecule template
- instances: Show all instantiations of a molecule

Also add `--molecule` flag to `gt spawn` for molecule-based workflows.
When specified, the molecule is instantiated on the parent issue first,
then the polecat is spawned on the first ready step.

🤝 Co-authored-by: Claude <noreply@anthropic.com>
2025-12-19 12:00:30 -08:00