Commit Graph

20 Commits

Author SHA1 Message Date
Steve Yegge
1611f16751 refactor: remove unused bd pin/unpin/hook commands (bd-x0zl)
Analysis found these commands are dead code:
- gt never calls `bd pin` - uses `bd update --status=pinned` instead
- Beads.Pin() wrapper exists but is never called
- bd hook functionality duplicated by gt mol status
- Code comment says "pinned field is cosmetic for bd hook visibility"

Removed:
- cmd/bd/pin.go
- cmd/bd/unpin.go
- cmd/bd/hook.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 16:02:15 -08:00
Steve Yegge
c8b912cbe6 bd sync: 2025-12-27 15:56:42 2025-12-27 15:56:42 -08:00
Steve Yegge
26785f9b46 refactor: remove bd mol catalog in favor of bd formula list (bd-ctmg)
- Delete mol_catalog.go (duplicate functionality)
- Update mol.go help text to point to bd formula list
- Update CLI_REFERENCE.md and MOLECULES.md docs
- Update deprecated template.go references

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 14:34:23 -08:00
Steve Yegge
cc7d2ae991 Rename bd mol ephemeral back to bd mol wisp
The verb 'wisp' fits the chemistry metaphor (pour, bond, burn, squash)
while 'ephemeral' is an adjective. The internal API field remains
'Ephemeral' but the CLI command is now 'bd mol wisp'.

Commands:
  bd mol wisp <proto>     - create ephemeral wisp
  bd mol wisp list        - list wisps
  bd mol wisp gc          - garbage collect old wisps
2025-12-26 23:47:00 -08:00
Steve Yegge
bf2f200754 Move pour and ephemeral under bd mol subcommand (bd-2fs7)
For consistency, all molecule operations are now under bd mol:
- bd mol pour <proto>     - create persistent mol
- bd mol ephemeral <proto> - create ephemeral mol
- bd mol ephemeral list   - list ephemeral issues
- bd mol ephemeral gc     - garbage collect old ephemeral issues

This aligns with existing mol subcommands: bond, squash, burn, etc.
2025-12-26 23:41:20 -08:00
Steve Yegge
ea8ae11002 feat: Rename 'wisp' to 'ephemeral' in beads API (bd-o18s)
BREAKING CHANGE: API field and CLI command renamed

- types.Issue.Wisp → types.Issue.Ephemeral
- JSON field: "wisp" → "ephemeral"
- CLI: bd wisp → bd ephemeral
- Flags: --wisp → --ephemeral
- ID prefix: wisp → eph

The SQLite column already uses 'ephemeral' so no schema migration needed.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 21:07:37 -08:00
Steve Yegge
f78fe883d0 feat: Distinct prefixes for protos, molecules, wisps (bd-hobo)
Added type-specific ID prefixes for better visual recognition:
- `bd pour` now generates IDs with "mol-" prefix
- `bd wisp create` now generates IDs with "wisp-" prefix
- Regular issues continue using the configured prefix

Implementation:
- Added IDPrefix field to types.Issue (internal, not exported to JSONL)
- Added Prefix field to CloneOptions for spawning operations
- Added IDPrefix to RPC CreateArgs for daemon communication
- Updated storage layer to use issue.IDPrefix when generating IDs
- Updated pour.go and wisp.go to pass appropriate prefixes

This enables instant visual recognition of entity types and prevents
accidental modification of templates.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 02:05:25 -08:00
Steve Yegge
dd0fb7ce90 Remove bd mol run - orchestration belongs in gt
bd mol run was a convenience combo (pour + assign + pin + start) that
felt like orchestration but lived in the data layer. This blurred the
architectural boundary between bd (data) and gt (orchestration).

- Delete cmd/bd/mol_run.go entirely
- Update mol.go help text to remove run reference
- Update mol_current.go to suggest bd pour instead

gt spawn will implement the orchestration combo by calling the atomic
bd commands (pour, update, pin) directly.

Closes bd-00u3

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 01:05:16 -08:00
Steve Yegge
9ad70cce64 refactor(mol): remove bd mol spawn - use pour/wisp only (bd-8y9t)
Remove the spawn command from bd mol. Proto instantiation now uses:
- bd pour <proto> - Instantiate as persistent mol (liquid phase)
- bd wisp create <proto> - Instantiate as ephemeral wisp (vapor phase)

Rationale:
- 'spawn' doesn't fit the chemistry metaphor
- Two phase transitions (pour/wisp) are clearer than one command with flags
- Avoids confusion about defaults

Changes:
- Delete mol_spawn.go
- Update mol.go, mol_catalog.go, mol_distill.go to reference pour/wisp
- Update pour.go and wisp.go to remove 'Equivalent to spawn' comments
- Update info.go changelog entries
- Update CHANGELOG.md, ARCHITECTURE.md, DELETIONS.md

Closes bd-8y9t
2025-12-24 12:52:47 -08:00
Steve Yegge
ee04b1ea96 feat: add dynamic molecule bonding with --ref flag (bd-xo1o.1)
Implements the Christmas Ornament pattern for patrol molecules:
- Add CloneOptions struct with ParentID and ChildRef for dynamic bonding
- Add generateBondedID() to create custom IDs like "patrol-x7k.arm-ace"
- Add --ref flag to `bd mol bond` for custom child references
- Variable substitution in childRef (e.g., "arm-{{polecat_name}}")

This enables:
  bd mol bond mol-polecat-arm bd-patrol --ref arm-{{name}} --var name=ace
  # Creates: bd-patrol.arm-ace, bd-patrol.arm-ace.capture, etc.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 03:38:38 -08:00
Steve Yegge
d6ab9ab62c feat(mol): spawn molecules as ephemeral by default (bd-2vh3.2)
Molecule spawning now creates ephemeral issues that can be bulk-deleted
when closed using `bd cleanup --ephemeral`. This supports the ephemeral
molecule workflow pattern where execution traces are cleaned up while
outcomes persist.

Changes:
- Add `ephemeral` parameter to cloneSubgraph() and spawnMolecule()
- mol spawn: ephemeral=true by default, add --persistent flag to opt out
- mol run: ephemeral=true (molecule execution)
- mol bond: ephemeral=true (bonded protos)
- template instantiate: ephemeral=false (deprecated, backwards compat)

This is Tier 1 of the ephemeral molecule workflow epic (bd-2vh3).

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 13:44:25 -08:00
Steve Yegge
ddfabbca58 refactor(mol): split 1218-line mol.go into subcommand files
Split monolithic mol.go into 7 focused files:
- mol.go (76 lines): root command, shared constants
- mol_catalog.go (83): bd mol catalog
- mol_show.go (76): bd mol show
- mol_spawn.go (238): bd mol spawn
- mol_run.go (137): bd mol run
- mol_bond.go (382): bd mol bond + helpers
- mol_distill.go (307): bd mol distill + helpers

Closes bd-cnwx

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 11:43:43 -08:00
Steve Yegge
213a61c2be fix(mol): persist template label in bondProtoProto + add comprehensive tests
Code review found that bondProtoProto was setting Labels on the compound
issue, but CreateIssue doesn't persist labels (they're stored separately.
Fixed by calling AddLabel after creating the compound.

Also added comprehensive tests for:
- isProto() - template label detection
- operandType() - proto vs molecule string
- minPriority() - priority comparison
- bondProtoProto() - compound proto creation with deps and labels
- bondProtoMol() - spawn proto and attach to molecule
- bondMolMol() - join two molecules with sequential/parallel bonds

Tests verify dependency types (blocks vs parent-child) based on bond type.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
EOF
)
2025-12-21 11:18:27 -08:00
Steve Yegge
6580178226 feat(mol): smart --var detection for distill accepts both syntaxes
Agents naturally use spawn-style (variable=value) for both spawn and
distill commands. Now distill accepts both:
- --var branch=feature-auth (spawn-style)
- --var feature-auth=branch (substitution-style)

Smart detection checks which side appears in the epic text:
- Right side found → spawn-style (left is varname)
- Left side found → substitution-style (left is value)
- Both found → prefers spawn-style (more common guess)

Embodies the Beads philosophy: watch what agents do, make their guess correct.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 11:10:04 -08:00
Steve Yegge
16518223a4 feat(mol): add --attach flag for spawn-time bonding
Adds --attach (repeatable) and --attach-type flags to bd mol spawn
for on-the-fly composition of molecules.

Usage:
  bd mol spawn mol-feature --attach mol-testing --attach mol-docs

Each attached proto is spawned and bonded to the primary molecule
using the specified bond type (default: sequential).

Also fixes a pre-existing bug where bondProtoMol and bondMolMol tried
to add both parent-child AND blocks dependencies between the same
issues, violating the UNIQUE constraint on (issue_id, depends_on_id).
Now sequential bonds use blocks type, parallel/conditional use
parent-child.

Closes bd-obep

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 10:43:27 -08:00
Steve Yegge
5bf3515e8e feat(mol): add distill command to extract protos from epics
Implements bd mol distill to reverse the spawn operation:
- molecule → proto (spawn is proto → molecule)

Features:
- --as flag for custom proto title
- --var value=variable to replace concrete values with placeholders
- --dry-run to preview the distilled structure
- Preserves full subgraph structure and dependencies
- Adds template label to all cloned issues

Also updates AGENTS.md with landing checklist.

Closes: bd-iq19

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 10:32:23 -08:00
Steve Yegge
386b513ed0 feat(mol): add polymorphic bond command
Implement bd mol bond for composing protos and molecules:
- proto + proto → compound proto (reusable template)
- proto + mol → spawn proto, attach to molecule
- mol + proto → spawn proto, attach to molecule
- mol + mol → join into compound molecule

Supports --type (sequential/parallel/conditional) and --dry-run flags.
Closes bd-o91r.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 10:10:43 -08:00
Steve Yegge
466c606eb9 feat(mol): rename bond→spawn, add BondRef data model
Molecule evolution:
- Rename `bd mol bond` to `bd mol spawn` for instantiation
- Add BondRef type for tracking compound lineage
- Add `bonded_from` field to Issue for compound molecules
- Add BondType constants (sequential, parallel, conditional, root)
- Add IsCompound() and GetConstituents() helpers
- Add 'protomolecule' easter egg alias

Closes: bd-mh4w, bd-rnnr
Part of: bd-o5xe (Molecule bonding epic)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 01:20:25 -08:00
Steve Yegge
8e17dcff6d feat(mol): add bd mol run command for durable execution
bd mol run = bond + assign + pin:
- Bonds the molecule (creates issues from template)
- Assigns root to the caller
- Sets root status to in_progress
- Pins root issue for session recovery

After a crash or session reset, the pinned root ensures the agent
can resume from where it left off by checking 'bd ready'.

This is the Gas Town integration point that makes molecules immortal.

Closes: bd-icnf

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 00:07:19 -08:00
Steve Yegge
ca678ca5ba feat(mol): add bd mol commands, deprecate bd template
Adds the mol command group for molecule workflows:
- bd mol catalog - list available molecules
- bd mol show <id> - show molecule structure and variables
- bd mol bond <id> --var k=v - instantiate a molecule

Molecules are templates with workflow semantics - they are the
orchestration primitive for Gas Town. This unifies the template
system under the mol command.

The template commands are deprecated but still work:
- bd template list -> use bd mol catalog
- bd template show -> use bd mol show
- bd template instantiate -> use bd mol bond

Closes: bd-ffjt

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 00:01:53 -08:00