Issue IDs like bd-E.10 now sort after bd-E.9 instead of before bd-E.2.
Adds NaturalCompareIDs to internal/utils and replaces string comparison
in list, graph, swarm, todo, and tree display code.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Extend write-path CTE and DFS cycle detection to include conditional-blocks
(also creates blocking relationships, same as blocks)
- Add explicit self-dependency check in AddDependencyInTx
- Add bd graph check subcommand: runs DetectCycles, reports results in
JSON or human-readable format, exits with code 1 if issues found
waits-for is intentionally excluded from cycle detection — it uses gate
semantics (fan-in) rather than direct blocking, so A waits-for B does
not mean B blocks A in the traditional sense.
Fixes: bd-2qr
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Children of an epic were placed in Layer 0 (no blocking deps) even when
their parent epic was in a higher layer due to blockers. This made the
graph misleading — children appeared "ready" while the parent was blocked.
After computing layers from blocking deps, a post-processing step now
lifts children to at least their parent's layer via parent-child deps.
Children with their own blocking deps that put them higher are unaffected.
Iterates until stable to handle nested parent-child hierarchies.
Amp-Thread-ID: https://ampcode.com/threads/T-019ca756-6480-7088-86a2-0d20013e61c7
Co-authored-by: Amp <amp@ampcode.com>
buildDependencyTree queried the dependencies table directly, bypassing
wisp routing that all other dependency methods use. Replace raw SQL
with GetDependencies/GetDependents which handle wisp-backed issues.
loadGraphSubgraph only traversed dependents (up direction) and
explicitly skipped dependencies for the root node, so `bd graph <id>`
showed the issue in isolation. Now traverse both directions via BFS.
Fixes#2145
Co-Authored-By: Claude <noreply@anthropic.com>
Convert ~250 instances of direct fmt.Fprintf(os.Stderr)+os.Exit(1)
to FatalError/FatalErrorWithHint/FatalErrorRespectJSON across 54 files.
Complex multi-line messages, warnings, loop-internal errors, and
JSON-branching patterns intentionally preserved where the helpers
do not fit cleanly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Run make fmt to fix all gofmt issues. Add nolint directives for:
- G204 (gosec) in cmd/bd/stubs.go: git args are internal, not user-supplied
- unparam in internal/syncbranch/worktree.go: error return kept for callers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/polecats/obsidian
Rig: beads
Role: polecats
Strip out the multi-backend storage layer: factory pattern, memory/in-memory
provider, connection string parsing, local provider, and associated tests.
Inline Dolt as the sole storage backend. Part of Dolt-Native Beads v2 epic.
WIP - SQLite removal in progress, more cleanup phases to follow.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
When bd show renders dependencies that reference external databases
(e.g., 'external:gastown:gt-42zaq'), it now follows the prefix routes
in routes.jsonl to locate and query the target database, displaying
the actual issue title, status, and priority instead of silently
dropping them.
The core fix adds resolveExternalDepsViaRouting() which:
1. Gets raw dependency records to find external refs
2. Extracts the issue ID from each external ref
3. Uses routing to look up the issue in the target database
4. Returns resolved IssueWithDependencyMetadata entries
Applied to: bd show (text + JSON), bd show --watch, bd graph, bd blocked.
Unresolvable external deps show as placeholders rather than being dropped.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/polecats/jasper
Rig: beads
Role: polecats
Replace the vertical layer-by-layer box view with a horizontal
column-based DAG that renders directly in the terminal. Nodes are
arranged in layer columns (left-to-right) with box-drawing edge
routing through gutter areas between columns. The old box view
is still available via --box flag.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
Add two new output formats to the bd graph command:
--dot: Graphviz DOT format output. Enables SVG/PNG generation via
graphviz pipeline (bd graph --dot <id> | dot -Tsvg > graph.svg).
Nodes are color-coded by status, edges distinguish blocks (solid)
from parent-child (dashed), and layers use subgraph clusters for
proper rank alignment.
--html: Self-contained interactive HTML with D3.js force-directed
graph. Drag nodes to rearrange, scroll to zoom, hover for details.
Dark theme, status-colored nodes, legend, and tooltip with full
issue metadata. Output to stdout for redirection to file.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
Since daemonClient is always nil (daemon_deprecated.go stub), every
`if daemonClient != nil` branch was dead code. This removes all 171
occurrences across 56 command files, keeping only the direct storage
(else) branches. Also cleans up unused rpc/json/types imports and
fixes variable shadowing issues left behind.
Part of Dolt transition Phase 2 (dolt-test-woho epic).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/crew/emma
Rig: beads
Role: crew
The ensureDatabaseFresh + daemonClient nil check + error handling
pattern was duplicated across 16 command files with inconsistent
error handling (some used FatalErrorRespectJSON, others fmt.Fprintf).
Extracted into requireFreshDB() wrapper that standardizes on
FatalErrorRespectJSON for consistent --json support.
Closes dolt-test-7y4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These read commands were querying the database without verifying it was
in sync with JSONL, causing users to get stale results without warning.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Multiple code paths were bypassing the storage factory and creating
SQLite databases directly, ignoring sync.mode=dolt-native configuration.
This caused SQLite/JSONL files to be created inappropriately when Dolt
connections failed transiently.
Changes:
- routed.go: Use GetRoutedStorageWithOpener with factory.NewFromConfig
- ship, swarm, move, refile, ready, graph: Replace sqlite.New with factory
- show.go: Use factory + simplify by using Storage interface methods
- doctor/*: Use factory for backend-aware storage creation
- CheckCompactionCandidates: Add backend check + CompactableStorage assertion
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
bd list --tree:
- Use actual parent-child dependencies instead of dotted ID hierarchy
- Treat epic dependencies as parent-child relationships
- Sort children by priority (P0 first)
- Fix tree display in daemon mode with read-only store access
bd graph:
- Add --all flag to show dependency graph of all open issues
- Add --compact flag for tree-style rendering (reduces 44+ lines to 13)
- Fix "needs:N" cognitive noise by using semantic colors
- Add blocks:N indicator with semantic red coloring
bd show:
- Tufte-aligned header with status icon, priority, and type badges
- Add glamour markdown rendering with auto light/dark mode detection
- Cap markdown line width at 100 chars for readability
- Mute entire row for closed dependencies (work done, no attention needed)
Design system:
- Add shared status icons (○ ◐ ● ✓ ❄) with semantic colors
- Implement priority colors: P0 red, P1 orange, P2 muted gold, P3-P4 neutral
- Add TrueColor profile for distinct hex color rendering
- Type badges for epic (purple) and bug (red)
Design principles:
- Semantic colors only for actionable items
- Closed items fade (muted gray)
- Icons > text labels for better scanability
Co-Authored-By: SageOx <ox@sageox.ai>
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>
Resolves conflicts and converts new defer/undefer commands from
fatih/color to the lipgloss semantic color system.
Key changes:
- Added StatusDeferred case in graph.go with ui.RenderAccent
- Converted status.go to use ui package for colorized output
- Converted defer.go/undefer.go to use ui package
- Merged GroupID and Aliases for status command
- Updated pre-commit hook version to 0.31.0
- Ran go mod tidy to remove fatih/color dependency
Replace all fatih/color usages with internal/ui package that provides:
- Semantic color tokens (Pass, Warn, Fail, Accent, Muted)
- Adaptive light/dark mode support via Lipgloss AdaptiveColor
- Ayu theme colors for consistent, accessible output
- Tufte-inspired data-ink ratio principles
Files migrated: 35 command files in cmd/bd/
Add docs/ui-philosophy.md documenting:
- Semantic token usage guidelines
- Light/dark terminal optimization rationale
- Tufte and perceptual UI/UX theory application
- When to use (and not use) color in CLI output
Add 'deferred' as a valid issue status for issues that are deliberately
put on ice - not blocked by dependencies, just postponed for later.
Changes:
- Add StatusDeferred constant and update IsValid() validation
- Add DeferredIssues to Statistics struct with counting in both SQLite
and memory storage
- Add 'bd defer' command to set status to deferred
- Add 'bd undefer' command to restore status to open
- Update help text across list, search, count, dep, stale, and config
- Update MCP server models and tools to accept deferred status
- Add deferred to blocker status checks (schema, cache, ready, compact)
- Add StatusDeferred to public API exports (beads.go, internal/beads)
- Add snowflake styling for deferred in dep tree and graph views
Semantics:
- deferred vs blocked: deferred is a choice, blocked is forced
- deferred vs closed: deferred will be revisited, closed is done
- Deferred issues excluded from 'bd ready' (already works since
default filter only includes open/in_progress)
- Deferred issues still block dependents (they are not done!)
- Deferred issues visible in 'bd list' and 'bd stale'
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The renderGraph function was being called with nil instead of the
loaded subgraph, causing a nil pointer dereference in
computeDependencyCounts when iterating over subgraph.Dependencies.
Changes:
- Pass subgraph variable to renderGraph instead of nil
- Add defensive nil check in computeDependencyCounts
- Add test case for nil subgraph handling
Fixes GH#657
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- graph.go: Pass subgraph to renderGraph() instead of nil (fixes#657)
The nil subgraph was dereferenced in computeDependencyCounts()
causing a panic when running `bd graph` on epics.
- postinstall.js: Wait for file.close() callback before resolving (fixes#652)
On Windows, the file was still locked when extraction started
because resolve() was called immediately after file.close()
without waiting for the close to complete.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Restore the subgraph parameter in renderGraph (previously marked as
unused with _) and use it to display meaningful dependency information:
- Add computeDependencyCounts() to calculate blocks/blocked-by counts
- Add renderNodeBoxWithDeps() to render nodes with dependency info
- Show "blocks:N" when an issue blocks N other issues
- Show "needs:N" when an issue depends on N other issues
- Add dependency summary showing total blocking relationships
This makes the graph visualization more informative by showing how
issues relate to each other in the dependency chain.
Tests added:
- TestComputeDependencyCounts: verifies dependency counting logic
- TestRenderNodeBoxWithDeps: verifies box rendering with dep info
Co-authored-by: Charles P. Cross <cpdata@users.noreply.github.com>
The subgraph parameter was passed to renderGraph but not used in the
function body, causing an unparam lint error. Replace with _ to
indicate intentional non-use.
The graph command now shows issues connected via any dependency type
(blocks, parent-child, etc.), not just parent-child relationships.
This makes bd graph useful for epics where children are connected via
blocks dependencies rather than hierarchical parent-child.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New command to visualize issue dependency graphs:
- Layered layout (Sugiyama-style) shows execution order
- Status coloring (open/in_progress/blocked/closed)
- Works with epics to show full subgraph
- Layer 0 = ready tasks (no blockers)
Usage: bd graph <issue-id>
Part of bd-r6a workflow system redesign.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>