bd ready as
dependency-ordered steps. They are usually instantiated from formulas, but a
formula is optional — any epic with children is a molecule.
What is a Molecule?
A molecule is a persistent instance of a proto (a cooked formula):- Contains steps with dependencies
- Persistent beads in the issue database, synced like any other bead
- Steps map to issues with parent-child relationships
| Term | Meaning | When to use |
|---|---|---|
| Epic | Parent issue with children | General term for hierarchical work |
| Molecule | Epic with execution intent | When discussing workflow traversal |
| Proto | Epic with the template label | Reusable pattern (optional) |
Creating Molecules
From a Formula
- Parent issue:
bd-xyz(the molecule root) - Child issues:
bd-xyz.1,bd-xyz.2, etc. (the steps)
Without a Formula
Create the epic and wire the dependencies directly:bd mol distill <epic-id> <formula-name>.
Finding Molecules
Viewing a Molecule
Working with Molecules
The Execution Model
An agent picks up a molecule and executes ready children in parallel until everything closes:- Get ready work:
bd ready --mol <molecule-id> - Claim it:
bd update <id> --claim - Do the work
- Close it:
bd close <id> - Repeat until the molecule is done
Dependency Types
Only some dependency types block execution:| Type | Semantics | Use case |
|---|---|---|
blocks | B can’t start until A closes | Sequencing work |
parent-child | If the parent is blocked, children are blocked | Hierarchy (children parallel by default) |
conditional-blocks | B runs only if A fails | Error-handling paths |
waits-for | B waits for all of A’s dynamic children | Fan-in gates — see Gates |
related, discovered-from, replies-to) link issues
without affecting execution.
Step Dependencies
In a formula, steps declareneeds:
bd ready command respects these:
Progressing Through Steps
Viewing Progress
Molecule Lifecycle
bd epic close-eligible sweeps
them). For cleanup of the beads themselves:
bd mol squash <id>condenses a molecule’s ephemeral children into a permanent digest issue.bd mol burn <id>deletes a molecule outright, no digest — for abandoned or test runs.
Bonding: Connecting Work Graphs
Bond means creating a dependency between two work graphs. When molecule A blocks molecule B, completing A unblocks B and an agent can continue from A into B — one compound workflow that can span days.| Operands | What happens |
|---|---|
| proto + proto | Compound proto (reusable template) |
| proto + molecule | Spawns the proto as new issues, attached to the molecule |
| molecule + molecule | Joins them into a compound molecule |
| formula + anything | The formula is cooked inline first |
--pour (force persistent) or --ephemeral (force
ephemeral) — see Wisps.
Dynamic Bonding
When the number of children isn’t known until runtime, bond in a loop with--ref to get readable child IDs instead of random hashes:
Advanced Features
Bond Points
Formulas can define bond points — named attachment sites for composition. Each names a step to attachbefore_step or after_step (with optional
parallel = true):
Hooks
Step-completion hooks are not currently exposed as runnable formula actions. The historicalon_complete.run example was invalid: run is
not a formula field, and on_complete runtime expansion is tracked
separately until it is wired end to end.
Assigning Molecules
Assign the molecule root to an agent at pour time, then track where each agent is:Agent Pitfalls
- Temporal language inverts dependencies. “Phase 1 comes before Phase 2”
tempts
bd dep add phase1 phase2— backwards. Use requirement language: “Phase 2 needs Phase 1” isbd dep add phase2 phase1. Verify withbd blocked. - Numbered steps don’t create sequence. Steps named “Step 1/2/3” still run in parallel until you add dependencies between them.
- Forgetting to close work. Blocked issues stay blocked forever if their
blockers aren’t closed:
bd close <id> --reason "Done".