- bd-hr39: Add `needs` field to Step as alias for depends_on. Converts
to blocking dependencies between sibling steps during cooking.
- bd-j4cr: Add `waits_for` field to Step. Values: all-children or
any-children. Preserved as gate:<value> label during cooking.
- bd-47qx: Add --prefix flag to bd cook command to prepend a prefix
to proto IDs, enabling use of project prefixes like gt-.
Includes validation, dry-run output, and comprehensive tests.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes from self-review of formula parser and bd cook:
1. Atomicity: Add cleanup on failure in cookFormula - if labels/deps
transaction fails, delete the already-created issues
2. Validation: Add recursive depends_on validation for child steps
and validate priority ranges for children
3. Documentation: Mark unimplemented fields (Expand, ExpandVars,
Condition, Gate) with TODO(future) comments
4. Thread safety: Add note that Parser is NOT thread-safe
5. Error messages: Track first definition location for duplicate ID
errors (e.g., "duplicate id at steps[1], first defined at steps[0]")
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements a new formula system for defining workflow templates in YAML:
- internal/formula/types.go: YAML schema types for .formula.yaml files
- Formula, Step, VarDef, ComposeRules, BondPoint, Gate types
- Support for workflow, expansion, and aspect formula types
- Variable definitions with required, default, enum, and pattern
- internal/formula/parser.go: Parser with extends/inheritance support
- Parse formula files from multiple search paths
- Resolve extends references for formula inheritance
- Variable extraction and substitution
- Variable validation (required, enum, pattern)
- cmd/bd/cook.go: bd cook command to compile formulas into protos
- Parse and resolve formula YAML
- Create proto bead with template label
- Create child issues for each step
- Set up parent-child and blocking dependencies
- Support --dry-run, --force, --search-path flags
Example workflow:
bd cook mol-feature.formula.yaml
bd pour mol-feature --var component=Auth --var framework=react
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This prevents a common mistake where users add dependencies from child
issues to their parent epics. This creates a deadlock:
- Child can't start (blocked by open parent)
- Parent can't close (children not done)
Changes:
- dep.go: Reject child→parent deps at creation time with clear error
- server_labels_deps_comments.go: Same check for daemon RPC
- doctor/validation.go: New check detects existing bad deps
- doctor/fix/validation.go: Auto-fix removes bad deps
- doctor.go: Wire up check and fix handler
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
The daemon sync functions (gitPushFromWorktree, syncBranchPull) were
checking git's branch tracking config and falling back to 'origin',
but ignoring bd's sync.remote config setting.
Now these functions check sync.remote config first, matching the
behavior of sync_check.go and sync_import.go.
Closes#736
Removes unnecessary parenthetical explanation about possible JSONL file names since findJSONLPath() already encapsulates that logic.
Co-authored-by: Charles P. Cross <cpdata@users.noreply.github.com>
Remove verbose parenthetical explanation from comment on line 73.
The comment now reads '// Get the actual JSONL path' instead of
'// Get the actual JSONL path (could be issues.jsonl, beads.base.jsonl, etc.)'
This is a documentation cleanup with no functional changes.
When 'bd doctor --fix' detects DB has more issues than JSONL, it runs
'bd export' to sync them. However, 'bd export' without -o flag outputs
to stdout instead of writing to .beads/issues.jsonl, making the fix a
no-op.
Add -o .beads/issues.jsonl --force to the export command to ensure the
JSONL file is actually updated.
Add a new --prune mode to `bd compact` that removes expired tombstones from
issues.jsonl without requiring AI compaction or deleting closed issues.
Features:
- `bd compact --prune` removes tombstones older than 30 days (default TTL)
- `bd compact --prune --older-than N` uses custom N-day TTL
- `bd compact --prune --dry-run` previews what would be pruned
- Supports --json output for programmatic use
This reduces sync overhead by eliminating accumulated tombstones that were
previously only pruned as a side effect of compaction or cleanup operations.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add integration tests for the deleteViaDaemon function that handles
client-side RPC deletion calls:
- TestDeleteViaDaemon_SuccessfulDeletion: Single issue deletion
- TestDeleteViaDaemon_CascadeDeletion: Cascade deletion through daemon
- TestDeleteViaDaemon_ForceDeletion: Force delete bypassing deps
- TestDeleteViaDaemon_DryRunMode: Preview without actual deletion
- TestDeleteViaDaemon_InvalidIssueID: Error handling for invalid IDs
- TestDeleteViaDaemon_BatchDeletion: Multiple issues at once
- TestDeleteViaDaemon_JSONOutput: JSON output validation
- TestDeleteViaDaemon_HumanReadableOutput: Human-readable formatting
- TestDeleteViaDaemon_DependencyConflict: Dependency conflict handling
- TestDeleteViaDaemon_EmptyIDs: Empty ID list handling
- TestDeleteViaDaemon_MultipleErrors: Mixed valid/invalid batch
- TestDeleteViaDaemon_DirectCall: Direct call with global client
- TestDeleteViaDaemon_DirectDryRun: Direct dry-run test
- TestDeleteViaDaemon_DirectHumanOutput: Direct human output test
- TestDeleteViaDaemon_DirectBatch: Direct batch deletion test
Coverage: 59.4% for deleteViaDaemon (remaining 40% is os.Exit paths)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add FatalErrorRespectJSON helper for JSON-aware error output
- Fix bd comments list returning null instead of [] for empty arrays
- Remove redundant local --json flags from show/update/close commands
that were shadowing the global persistent --json flag
- Update show command error handlers to use FatalErrorRespectJSON
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add the --priority (-p) flag to bd export for filtering by exact priority,
matching the behavior of bd list. This completes the comprehensive filtering
support for bd export.
The flag uses cmd.Flags().Changed() to properly handle P0 (priority 0), which
would otherwise be interpreted as "not set" due to Go zero-value semantics.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added daemon-compatible functions for template operations:
- loadTemplateSubgraphViaDaemon: loads template subgraph via RPC calls
- cloneSubgraphViaDaemon: creates new issues from template via RPC
- Updated templateShowCmd and templateInstantiateCmd to use daemon path
The template commands were using storage.Storage directly even when
daemon was connected, causing "no database connection" errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extract readFromGitRef helper function to eliminate duplicate code for
running git show <ref>:<path> commands. The helper is now used by:
- checkGitForIssues() in autoimport.go
- importFromGit() in autoimport.go
- readFirstIssueFromGit() in init.go
The scanning/parsing logic is intentionally kept separate since each
function has different requirements (error handling, SetDefaults, etc).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Test scenarios cover:
- Successful tombstone creation with actor/reason tracking
- Original type preservation in tombstone
- Audit trail recording
- Issue deletion with dependency cleanup
- Error handling for non-existent issues
- Unsupported storage backend fallback
Both functions achieve 100% test coverage.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
`bd config set no-db true` now correctly writes to config.yaml instead of
SQLite. Previously, startup flags like no-db, no-daemon, no-auto-flush were
stored in SQLite but read from config.yaml at startup - making the command
appear to work while having no effect.
This adds:
- yaml_config.go: Defines yaml-only keys and provides SetYamlConfig/GetYamlConfig
- Updated config set/get commands to route yaml-only keys appropriately
- Comprehensive tests for yaml config handling
Startup flags affected: no-db, no-daemon, no-auto-flush, no-auto-import,
json, auto-start-daemon, flush-debounce, lock-timeout, git.*, sync.*, routing.*
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add --template-db flag and auto-discovery for wisp molecule spawning.
When --db contains .beads-wisp, auto-discover the main database to read
templates from while writing spawned instances to wisp storage.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The prefix mismatch detection was using ExtractIssuePrefix() which
tries to guess the prefix by analyzing suffix patterns. This failed
for multi-hyphen prefixes like "asianops-audit-" when issue IDs had
word-like suffixes (e.g., "asianops-audit-test") - the heuristic
would fall back to the first hyphen and report "asianops-" as the
prefix.
Fixed by checking directly if the issue ID starts with the configured
prefix using strings.HasPrefix(). This is more reliable than guessing
since we know the expected prefix from the database config.
Added test case TestImportMultiHyphenPrefix to prevent regression.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
bondProtoMol was hardcoding Wisp=true, ignoring --pour flag.
Now passes pour parameter through the call chain so --pour
correctly creates persistent (non-wisp) issues.
The --stealth flag was writing absolute paths to global gitignore, but
git pattern matching does not support absolute paths in gitignore files.
Patterns are interpreted relative to the gitignore location, making
absolute paths like /home/user/project/.beads/ never match.
Fix: Use .git/info/exclude which is the git-recommended location for
user-specific, per-repository ignores. Patterns here are relative to
repo root, so .beads/ works correctly.
Benefits:
- Patterns actually work (fixes the bug)
- Per-repo isolation (stealth in one repo does not affect others)
- No global gitignore pollution
- Follows git best practices for user-local ignores
Generated with Claude Code
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add gate operation constants (OpGateCreate, OpGateList, OpGateShow,
OpGateClose, OpGateWait) to protocol.go
- Add Gate*Args and Gate*Result types to protocol.go
- Add gate handler methods (handleGateCreate, handleGateList,
handleGateShow, handleGateClose, handleGateWait) to server_issues_epics.go
- Register gate handlers in handleRequest switch
- Add gate client methods (GateCreate, GateList, GateShow, GateClose,
GateWait) to client.go
- Update cmd/bd/gate.go to use daemon client when available, falling
back to direct store access
Gate commands now work with the daemon, eliminating the need for
--no-daemon flag.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace direct fmt.Fprintf(os.Stderr, "Error:...") + os.Exit(1) patterns with
FatalError() and FatalErrorWithHint() helpers for consistent error handling.
Files updated:
- compact.go: All 48 os.Exit(1) calls converted
- sync.go: All error patterns converted (kept 1 valid summary exit)
- migrate.go: Partial conversion (4 patterns converted)
This is incremental progress on bd-qioh. Remaining work: ~326 error patterns
across other cmd/bd files.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add parity with bd list for filtering:
- Exact priority match with --priority/-p
- Pattern matching: --title-contains, --desc-contains, --notes-contains
- Empty/null checks: --empty-description, --no-assignee, --no-labels
- Allow empty query when filters are provided (e.g., bd search --no-assignee)
All filters work in both direct and daemon mode via RPC.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements on_close hooks in .beads/config.yaml for automation and
notifications. Hooks receive issue data via environment variables
(BEAD_ID, BEAD_TITLE, BEAD_TYPE, BEAD_PRIORITY, BEAD_CLOSE_REASON)
and run via sh -c.
Changes:
- internal/config: Add HookEntry type and GetCloseHooks()
- internal/hooks: Add RunConfigCloseHooks() for executing config hooks
- cmd/bd: Call RunConfigCloseHooks after successful close
- docs/CONFIG.md: Document hooks configuration with examples
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add --verbose/-v flag to show all checks including passed
- Show summary at top with counts (passed/warnings/errors)
- Default mode collapses passed checks with hint to use --verbose
- Group passed checks by category in verbose mode
- Errors shown first, then warnings, then passed
- Visual separators between sections
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat(doctor): add count-based database size check
Adds CheckDatabaseSize (Check 29) that warns when closed issues exceed a configurable threshold (default: 5000). The check is informational only - no auto-fix since pruning is destructive.
Also improves fix guidance for sync-branch hook compatibility and legacy JSONL filename checks.
PR #724 by @rsnodgrass
Jira CLIs use --resolution flag (go-jira, jira-cli). Adding this as a
hidden alias improves agent ergonomics - LLMs have a prior for this flag.
Follows same pattern as --body alias for --description (GitHub CLI).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add async gates - coordination primitives for agents to wait on external events
like CI completion, PR merges, timers, or human approval.
Changes:
- Add 'gate' issue type to types.go with gate-specific fields:
- AwaitType: condition type (gh:run, gh:pr, timer, human, mail)
- AwaitID: condition identifier
- Timeout: max wait duration
- Waiters: mail addresses to notify when gate clears
- Add SQLite migration 027_gate_columns for new fields
- Update all SQLite storage queries to handle gate fields
- Add bd gate commands: create, show, list, close, wait
- All commands support --json output and --no-daemon mode
Closes: bd-2v0f, bd-lz49, bd-u66e
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add _ = prefix for ignored Close/Remove return values
- Fix unused cmd parameter in runMoleculeReady
- Add nolint:misspell for intentional British "cancelled" spelling
- Update comments to use US spelling where not intentional
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds release notes for v0.35.0 including:
- Dynamic molecule bonding with --ref flag
- bd activity command for real-time state feed
- waits-for dependency type for fanout gates
- Parallel step detection for molecules
- bd list --parent flag
- Molecule navigation commands
- Performance indexes and bug fixes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add emitRichMutation() function for events with metadata
- handleClose now emits MutationStatus with old/new status
- handleUpdate detects status changes and emits MutationStatus
- Add comprehensive tests for rich mutation events
Also:
- Add activity.go test coverage (bd-3jcw):
- Tests for parseDurationString, filterEvents, formatEvent
- Tests for all mutation type displays
- Fix silent error handling in --follow mode (bd-csnr):
- Track consecutive daemon failures
- Show warning after 5 failures (rate-limited to 30s)
- Show reconnection message on recovery
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds 'waits-for' dependency type for dynamic molecule bonding:
- DepWaitsFor blocks an issue until spawner's children are closed
- Two gate types: all-children (wait for all) or any-children (first)
- Updated blocked_cache.go CTE to handle waits-for dependencies
- Added --waits-for and --waits-for-gate flags to bd create command
- Added WaitsForMeta struct for gate metadata storage
- Full test coverage for all gate types and dynamic child scenarios
This enables patrol molecules to wait for dynamically-bonded arms to
complete before proceeding (Christmas Ornament pattern).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add --parallel flag to `bd mol show` that analyzes molecule structure
and identifies which steps can run in parallel. Also add --mol flag to
`bd ready` to list ready steps within a specific molecule.
Features:
- `bd mol show <id> --parallel`: Shows parallel group annotations
- `bd ready --mol <id>`: Lists ready steps with parallel opportunities
- Detects steps at same blocking depth that can parallelize
- Groups steps without mutual blocking deps into parallel groups
- JSON output includes full parallel analysis
Algorithm:
- Build dependency graph from blocking deps (blocks, conditional-blocks)
- Calculate blocking depth (distance from unblocked state)
- Group steps at same depth with no mutual blocking into parallel groups
- Mark steps as ready if open/in_progress with no open blockers
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>