Consolidate `bd stats` and `bd status` into a unified command:
- Add `stats` as alias for `status` command
- Add colorized output with emoji header
- Include all Statistics fields (tombstones, pinned, epics, lead time)
- Add `--no-activity` flag to skip git activity parsing
- Remove standalone statsCmd from ready.go (~90 lines)
- Update StatusOutput to use types.Statistics directly
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Failure Type: Real
Root Cause: Test was not initializing the global rootCtx variable that getAssignedStatus depends on, causing it to return nil
Fix Applied: Added rootCtx initialization with proper cleanup using defer, matching the pattern used in other tests
Verification: All tests now pass (go test ./...)
Fixes bd-9f86-baseline-test
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Complete implementation of signal-aware context propagation for graceful
cancellation across all commands and storage operations.
Key changes:
1. Signal-aware contexts (bd-rtp):
- Added rootCtx/rootCancel in main.go using signal.NotifyContext()
- Set up in PersistentPreRun, cancelled in PersistentPostRun
- Daemon uses same pattern in runDaemonLoop()
- Handles SIGINT/SIGTERM for graceful shutdown
2. Context propagation (bd-yb8):
- All commands now use rootCtx instead of context.Background()
- sqlite.New() receives context for cancellable operations
- Database operations respect context cancellation
- Storage layer propagates context through all queries
3. Cancellation tests (bd-2o2):
- Added import_cancellation_test.go with comprehensive tests
- Added export cancellation test in export_test.go
- Tests verify database integrity after cancellation
- All cancellation tests passing
Fixes applied during review:
- Fixed rootCtx lifecycle (removed premature defer from PersistentPreRun)
- Fixed test context contamination (reset rootCtx in test cleanup)
- Fixed export tests missing context setup
Impact:
- Pressing Ctrl+C during import/export now cancels gracefully
- No database corruption or hanging transactions
- Clean shutdown of all operations
Tested:
- go build ./cmd/bd ✓
- go test ./cmd/bd -run TestImportCancellation ✓
- go test ./cmd/bd -run TestExportCommand ✓
- Manual Ctrl+C testing verified
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implement a new `bd status` command that provides a quick snapshot of the
issue database state, similar to how `git status` shows working tree state.
Features:
- Summary counts by state (open, in-progress, blocked, closed)
- Ready to work count
- Recent activity stats (last 7 days): created, closed, updated issues
- Support for --assigned flag to filter by current user
- JSON output format with --json flag
- Comprehensive test coverage
Usage examples:
bd status # Show summary
bd status --json # JSON output
bd status --assigned # Filter to assigned issues
bd status --no-daemon # Direct mode with recent activity
Note: Recent activity currently only works in direct mode (--no-daemon).
Daemon mode support marked with TODO for future enhancement.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>