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>
Filters issues by parent issue ID using parent-child dependencies.
Example: bd list --parent=bd-xyz --status=open
Changes:
- Add ParentID field to IssueFilter type
- Add --parent flag to list command
- Forward parent filter through RPC
- Implement filtering in SQLite and memory storage
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove dual code paths in the autoflush system. FlushManager is now the
only code path for auto-flush operations.
Changes:
- Remove legacy globals: isDirty, needsFullExport, flushTimer
- Remove flushToJSONL() wrapper function (was backward-compat shim)
- Simplify markDirtyAndScheduleFlush/FullExport to just call FlushManager
- Update tests to use FlushManager or flushToJSONLWithState directly
FlushManager handles all flush state internally in its run() goroutine,
eliminating the need for global state. Sandbox mode and tests that do
not need flushing get a no-op when FlushManager is nil.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Conditional bonds now work as documented: "B runs only if A fails".
Implementation:
- Add DepConditionalBlocks dependency type to types.go
- Add IsFailureClose() helper to detect failure keywords in close_reason
- Update blocked cache to handle conditional-blocks:
- B is blocked while A is open
- B stays blocked if A closes with success
- B becomes unblocked if A closes with failure
Failure keywords: failed, rejected, wontfix, cancelled, abandoned,
blocked, error, timeout, aborted (case-insensitive)
Updated bondProtoProto, bondProtoMol, bondMolMol to use
DepConditionalBlocks for conditional bond type.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add new Maintenance category to bd doctor with checks for:
- Stale closed issues (older than 30 days)
- Expired tombstones (older than TTL)
- Compaction candidates (info only)
Add fix handlers for cleanup and tombstone pruning via bd doctor --fix.
Add deprecation hints to cleanup, compact, and detect-pollution commands
suggesting users try bd doctor instead.
This consolidation reduces cognitive load - users just need to remember
'bd doctor' for health checks and 'bd doctor --fix' for maintenance.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add testEnv struct with common test helper methods to test_helpers.go
- Methods include CreateIssue, CreateEpic, AddDep, AddParentChild, Close,
GetReadyWork, AssertReady, AssertBlocked
- Migrate 12+ tests in ready_test.go to use new helpers (-252 lines)
- Migrate 3 tests in dependencies_test.go to use new helpers (-34 lines)
- Total reduction: ~286 lines from test files
The testEnv pattern makes tests more readable and maintainable by:
- Eliminating boilerplate setup (store, cleanup, ctx)
- Providing semantic helper methods (AddDep vs manual AddDependency)
- Using t.Cleanup for automatic resource management
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When multiple bd commands are run in parallel, they can race during database
migrations, causing "duplicate column name" errors. This happens because:
1. Process A checks if column exists → false
2. Process B checks if column exists → false
3. Process A adds column → succeeds
4. Process B adds column → FAILS (duplicate column)
Changes:
- Wrap RunMigrations in BEGIN EXCLUSIVE transaction to serialize migrations
- Disable foreign keys BEFORE the transaction (PRAGMA must be called outside tx)
- Convert nested BEGIN/COMMIT in migrations 010, 022, 025 to use SAVEPOINTs
(SQLite does not support nested transactions)
- Remove redundant PRAGMA foreign_keys calls from individual migrations
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The test was creating an empty .beads/ directory after simulating rm -rf,
but FindBeadsDir() requires some project files (config.yaml, metadata.json,
or *.db/*.jsonl) to recognize a directory as a valid beads directory.
Updated the test to create a minimal config.yaml like bd init actually does
before auto-import runs. This makes the test more realistic and fixes the
flakiness.
FindJSONLInDir() was returning interactions.jsonl when issues.jsonl
didn't exist. This caused bd sync to write issue data to the wrong
file after fresh init.
Add interactions.jsonl to the skip list alongside deletions.jsonl
and merge artifacts, so the function correctly defaults to issues.jsonl.
When using bd create -f with a running daemon, the command would fail
with 'database not initialized' because it bypassed the daemon RPC path.
The fix adds createIssuesFromMarkdownViaDaemon which:
- Parses the markdown file (no store access needed)
- Converts issue templates to CreateArgs
- Uses daemon Batch RPC to create all issues efficiently
- Preserves all features: labels, dependencies, hooks, JSON output
Tested with daemon and non-daemon modes, verifying priority 0 is
preserved correctly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migration 026_additional_indexes adds 5 indexes identified during schema review (bd-h0we):
- idx_issues_updated_at: For GetStaleIssues date filtering
- idx_issues_status_priority: For common list query patterns
- idx_labels_label_issue: Covering index for label lookups
- idx_dependencies_issue_type: For blocked issues queries
- idx_events_issue_type: For close reason queries
These indexes improve query performance for common operations,
particularly at scale (10K+ issues).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
External dependencies (external:project:capability) are now visible in
the dependency tree output. Previously they were invisible because the
recursive CTE only JOINed against the issues table.
Changes:
- GetDependencyTree now fetches external deps and adds them as synthetic
leaf nodes with resolution status (satisfied/blocked)
- formatTreeNode displays external deps with special formatting
- Added helper parseExternalRefParts for parsing external refs
Test coverage added for:
- External deps appearing in dependency tree
- Cycle detection ignoring external refs
- CheckExternalDep when target has no .beads directory
- Various invalid external ref format variations
Closes: bd-vks2, bd-mv6h, bd-d9mu
GetBlockedIssues was showing external deps as blocking even when they
were satisfied (had a closed issue with provides:capability label).
Added filterBlockedByExternalDeps() which:
- Collects all external refs from blocked issues
- Checks each with CheckExternalDeps() in batch
- Filters satisfied refs from BlockedBy lists
- Updates BlockedByCount accordingly
- Removes issues with no remaining blockers (unless status=blocked/deferred)
This matches the behavior of GetReadyWork which already filters by
external deps correctly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove TestFindJSONLPathDefault from .test-skip (now passes)
- Add explanatory comments to 24 ignored error locations in cmd/bd:
- Cobra flag methods (MarkHidden, MarkRequired, MarkDeprecated)
- Best-effort cleanup/close operations
- Process signaling operations
Part of code health review epic bd-tggf.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add git.GetRepoRoot() with Windows path normalization
- Update beads.findGitRoot() to delegate to git.GetRepoRoot()
- Replace findBeadsDir() with beads.FindBeadsDir() across 8 files
- Remove duplicate findBeadsDir() and findGitRoot() function definitions
- Remove dead test code (TestInfoCommand, TestInfoWithNoDaemon)
- Update tests to work with consolidated APIs
Part of Code Health Review Dec 2025 epic (bd-tggf).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>