Commit Graph

379 Commits

Author SHA1 Message Date
Steve Yegge
7421f525fb Fix daemon race condition: prevent stale exports
- Add JSONL timestamp check in validatePreExport
- Refuse export if JSONL is newer than database
- Force daemon to import before exporting when JSONL updated
- Add test case for JSONL-newer-than-DB scenario
- Fixes bd-89e2
2025-11-01 22:01:41 -07:00
Steve Yegge
6e8907335f Add test coverage for daemon lifecycle and config modules
- Add config_test.go: tests for daemon configuration (local/global, sync behavior)
- Add daemon_test.go: tests for daemon lifecycle (creation, shutdown, database path resolution)
- Add process_test.go: tests for daemon lock acquisition and release
- Closes bd-2b34.6, bd-2b34.7

Amp-Thread-ID: https://ampcode.com/threads/T-4419d1ab-4105-4e75-bea8-1837ee80e2c2
Co-authored-by: Amp <amp@ampcode.com>
2025-11-01 21:27:09 -07:00
Steve Yegge
8a76b52cfc Merge branch 'main' of github.com:steveyegge/beads 2025-11-01 20:29:24 -07:00
Steve Yegge
5fabb5fdcc Fix bd-c6cf: Force full export when export_hashes is cleared
When validateJSONLIntegrity() clears export_hashes due to hash mismatch
or missing JSONL, the subsequent export now correctly exports ALL issues
instead of only dirty ones, preventing permanent database divergence.

Changes:
- validateJSONLIntegrity() returns (needsFullExport, error) to signal when
  export_hashes was cleared
- flushToJSONL() moved integrity check BEFORE isDirty gate so integrity
  issues trigger export even when nothing is dirty
- Missing JSONL treated as non-fatal force-full-export case
- Increased scanner buffer from 64KB to 2MB to handle large JSON lines
- Added scanner.Err() check to catch buffer overflow errors
- Updated all tests to verify needsFullExport flag

Fixes database divergence issue where clearing export_hashes didn't
trigger re-export, causing 5 issues to disappear from JSONL in fred clone.

Amp-Thread-ID: https://ampcode.com/threads/T-bf2fdcd6-7bbd-4c30-b1db-746b928c93b8
Co-authored-by: Amp <amp@ampcode.com>
2025-11-01 20:29:13 -07:00
Steve Yegge
ed1eca9064 Add circular dependency detection to bd doctor
- Added checkDependencyCycles() function using recursive CTE
- Integrated as Check #10 in runDiagnostics()
- Reports error status with count and fix suggestion if cycles found
- Updated doctor command documentation
- Fixes bd-3e3b
2025-11-01 20:18:37 -07:00
Nikolai Prokoschenko
c65cfa1ebd Add dependency and dependent counts to bd list JSON output (#198)
When using `bd list --json`, each issue now includes:
- `dependency_count`: Number of issues this issue depends on
- `dependent_count`: Number of issues that depend on this issue

This provides quick access to dependency relationship counts without
needing to fetch full dependency lists or run multiple bd show commands.

Performance:
- Uses single bulk query (GetDependencyCounts) instead of N individual queries
- Overhead: ~26% for 500 issues (24ms vs 19ms baseline)
- Avoids N+1 query problem that would have caused 2.2x slowdown

Implementation:
- Added GetDependencyCounts() to Storage interface for bulk counting
- Efficient SQLite query using UNION ALL + GROUP BY
- Memory storage implementation for testing
- Moved IssueWithCounts to types package to avoid duplication
- Both RPC and direct modes use optimized bulk query

Tests:
- Added comprehensive tests for GetDependencyCounts
- Tests cover: normal operation, empty list, nonexistent IDs
- All existing tests continue to pass

Backwards compatible: JSON structure is additive, all original fields preserved.

Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-01 19:59:15 -07:00
Midworld Kim
21ab565819 Fix hyphenated issue prefix detection (#199)
- update prefix/number parsing to use the last hyphen across utils and nodb paths
- add regression tests covering multi-hyphen prefixes in both packages
2025-11-01 19:57:37 -07:00
Steve Yegge
537844cb11 Fix bd-36870264: Prevent nested .beads directories with path canonicalization
- Add filepath.Abs() + EvalSymlinks() to FindDatabasePath() to normalize all database paths
- Add nested .beads directory detection in setupDaemonLock() with helpful error messages
- Prevents infinite .beads/.beads/.beads/ recursion when using relative BEADS_DB paths
- All acceptance criteria passed: singleton enforcement, lock release, no recursion

Amp-Thread-ID: https://ampcode.com/threads/T-c7fc78b8-a935-48dc-8453-a1bd47a14f72
Co-authored-by: Amp <amp@ampcode.com>
2025-11-01 19:50:34 -07:00
Steve Yegge
a708c321fb Fix bd-11e0: Auto-upgrade database version in daemon instead of exiting 2025-11-01 19:28:37 -07:00
Steve Yegge
eb00ab8005 Refactor daemon.go for testability and maintainability (bd-2b34)
- Split 1567-line daemon.go into 5 focused modules
- daemon_config.go (122 lines): config/path resolution
- daemon_lifecycle.go (451 lines): start/stop/status/health/metrics
- daemon_sync.go (510 lines): export/import/sync logic
- daemon_server.go (115 lines): RPC server setup
- daemon_logger.go (43 lines): logging utilities
- Reduced main daemon.go to 389 lines (75% reduction)
- All tests pass, improved code organization

Amp-Thread-ID: https://ampcode.com/threads/T-7504c501-f962-4b82-a6d9-8e33f547757d
Co-authored-by: Amp <amp@ampcode.com>
2025-11-01 19:20:01 -07:00
Steve Yegge
d80e7a5fd2 Fix bd-6c68: preserve actual daemon failure reasons in bd info
Don't override connect_failed/health_failed with auto_start_disabled.
This preserves important diagnostic information about whether the
daemon crashed vs. was never running.

Amp-Thread-ID: https://ampcode.com/threads/T-a8da544a-3e59-4293-903c-ce6be85fc28b
Co-authored-by: Amp <amp@ampcode.com>
2025-11-01 19:14:24 -07:00
Steve Yegge
b5839b656d Fix compilation errors in internal/daemonrunner package
Created missing files:
- logger.go: Logger type, setupLogger method, and env helpers
- signals_unix.go: Unix signal definitions (SIGTERM, SIGINT, SIGHUP)
- signals_windows.go: Windows signal definitions
- sync.go: Sync loop implementation with export/import/validation helpers

Fixed errors:
- Added missing 'version' parameter to acquireDaemonLock call
- Removed duplicate setupLock method from process.go (kept in daemon.go)
- Removed duplicate startRPCServer from daemon.go (kept in rpc.go)
- Fixed LogPath -> LogFile config field reference
- Removed unused 'io' import from process.go

Implementation notes:
- exportToJSONL: Full implementation with dependencies, labels, comments
- importFromJSONL: Placeholder (TODO: extract from cmd/bd/import.go)
- countDBIssues: Uses SQL COUNT(*) optimization with fallback
- validatePostImport: Checks for data loss
- runSyncLoop/runEventLoop: Main daemon event loops with signal handling

All packages now compile successfully with 'go build ./...'

Amp-Thread-ID: https://ampcode.com/threads/T-36a7f730-3420-426f-9e23-f13d5fa089c4
Co-authored-by: Amp <amp@ampcode.com>
2025-11-01 19:10:27 -07:00
Steve Yegge
f8ef180239 Fix bd-e652: Improve bd doctor daemon health checks
- Use path normalization (EvalSymlinks) to reliably match daemons across symlinks
- Check for stale sockets directly (catches cases where RPC failed)
- Detect multiple daemons for same workspace
- Enhanced error details for stale daemon detection
- Use global daemon registry instead of path-scoped discovery
2025-11-01 17:05:47 -07:00
Steve Yegge
70358d02c9 Add two-repo daemon auto-import test for bd-09b5f2f5
Test proves the bug exists:
- Agent A closes issue and pushes
- Agent B does git pull (JSONL shows 'closed')
- Daemon query returns 'open' (stale SQLite)

Test currently fails, confirming daemon doesn't auto-import
after git pull updates JSONL. Will pass once fix is complete.
2025-11-01 12:41:49 -07:00
Steve Yegge
d12b5b7221 Fix bd doctor to respect custom database names from config.json
Fixes #197: bd doctor was hardcoded to look for beads.db and didn't
check config.json for custom database names like beady.db.

Now both checkDatabaseVersion() and checkIDFormat() check config.json
first before falling back to the canonical database name.
2025-11-01 11:56:48 -07:00
Steve Yegge
69e2144e88 Improve cmd/bd test coverage to 42.9%
- Add epic_test.go with 3 tests for epic functionality
- Enhance compact_test.go with dry-run scenario tests
- Test epic-child relationships via dependencies
- All tests passing

Closes bd-27ea

Amp-Thread-ID: https://ampcode.com/threads/T-d88e08a0-f082-47a3-82dd-0a9b9117ecbf
Co-authored-by: Amp <amp@ampcode.com>
2025-11-01 11:11:20 -07:00
Steve Yegge
77819ff63c chore: Bump version to 0.21.2 2025-11-01 10:43:38 -07:00
Steve Yegge
731ab31dc6 chore: Bump version to 0.21.1 2025-10-31 23:47:20 -07:00
Steve Yegge
cc7918daf4 Implement bd stale command (bd-c01f, closes #184)
- Add bd stale command to find abandoned/forgotten issues
- Support --days (default 30), --status, --limit, --json flags
- Implement GetStaleIssues in SQLite and Memory storage
- Add full RPC/daemon support
- Comprehensive test suite (6 tests, all passing)
- Update AGENTS.md documentation

Resolves GitHub issue #184

Amp-Thread-ID: https://ampcode.com/threads/T-f021ddb8-54e3-41bf-ba7a-071749663c1d
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 23:03:56 -07:00
Steve Yegge
2d6a32a7db Merge branch 'main' of github.com:steveyegge/beads 2025-10-31 22:39:54 -07:00
Steve Yegge
acb731a4ec bd sync: 2025-10-31 22:39:53 2025-10-31 22:39:53 -07:00
Steve Yegge
727aaf910e Add --json flag to delete command
Amp-Thread-ID: https://ampcode.com/threads/T-91803e1e-9e64-431e-87d8-d868ddab71d4
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 22:38:39 -07:00
Steve Yegge
079effdaeb Fix bd-373c: Surface daemon errors when multiple .db files exist
When daemon detects multiple .db files (after filtering .backup and vc.db),
it now writes detailed error to .beads/daemon-error file before exiting.

The error file is checked and displayed when:
- Daemon discovery fails to connect
- Auto-start fails to yield a running daemon
- User runs 'bd daemons list'

This makes the error immediately visible without requiring users to check
daemon logs.

Changes:
- cmd/bd/daemon.go: Write daemon-error file on multiple .db detection
- internal/daemon/discovery.go: Read and surface daemon-error in DaemonInfo.Error
- cmd/bd/main.go: Display daemon-error when auto-start fails

Amp-Thread-ID: https://ampcode.com/threads/T-1005a8d1-7a5a-4844-ad2d-2b8a6145825f
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 22:01:45 -07:00
Steve Yegge
520af76234 Add comprehensive tests for create.go functionality
- Add 10 test cases covering basic creation, descriptions, design/acceptance
- Test labels, dependencies, discovered-from, explicit IDs, assignees
- Test all issue types and multiple dependencies
- All tests passing
- Maintains 27.6% coverage in cmd/bd

Amp-Thread-ID: https://ampcode.com/threads/T-2925a09a-b56d-4a2e-b79f-2d467c76feb2
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 21:51:54 -07:00
Steve Yegge
5a7e1b7c75 Fix bd sync git pull command to be explicit about remote and branch 2025-10-31 21:34:34 -07:00
Steve Yegge
0b852f52d9 Remove obsolete renumber and stale commands, fix test
- Remove renumber.go: Hash IDs eliminated need for ID compaction
- Remove stale.go: Executor/heartbeat tables were never implemented
- Fix TestListCommand: duplicate dependency constraint violation
- Update comments removing references to removed commands

Amp-Thread-ID: https://ampcode.com/threads/T-3dcd8681-c7d3-4fe1-9750-b38279b56cdb
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 21:27:33 -07:00
Steve Yegge
af517b4b10 Enhance bd doctor with operational health checks (bd-40a0) 2025-10-31 21:27:05 -07:00
Steve Yegge
31fcb06059 Fix daemon crash when backup/vc.db files exist
- Changed backup file filtering from checking file extension (.backup) to checking if filename contains '.backup'
- This now properly filters files like 'beads.backup-pre-hash-20251030-171258.db'
- Also exclude vc.db from database detection
- Add strings import to beads.go
- Improve error message to suggest manual removal

Fixes bd-373c
2025-10-31 21:18:08 -07:00
Steve Yegge
77142e9db3 Improve cmd/bd test coverage from 21% to 26.2%
- Add test for runCompactStats function (both JSON and regular output)
- Add tests for outputDotFormat and outputFormattedList functions
- Test dot format, digraph preset, custom templates, and error cases
- Coverage increased from 21.0% to 26.2% (5.2 percentage points)

Part of bd-27ea (multi-session effort to reach 40% coverage)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 20:40:04 -07:00
Steve Yegge
c840ba50bc Add comprehensive tests for show.go commands (bd-12c2)
Added test coverage for show, update, close, and edit commands in
cmd/bd/show_test.go:

- TestShowCommand (6 subtests): single/multiple issues, JSON output,
  dependencies, labels, compaction
- TestUpdateCommand (11 subtests): status, priority, title, assignee,
  description, design, notes, acceptance criteria, multiple fields/issues
- TestCloseCommand (4 subtests): single/multiple issues, JSON output,
  with/without reason
- TestEditCommand (1 subtest): argument validation

Key improvements:
- Properly sets global store variable to avoid "no issue found" errors
- Uses direct mode (BEADS_NO_DAEMON=1) for test isolation
- Follows existing test patterns from init_test.go and list_test.go
- All 22 test cases passing

Total cmd/bd coverage improved to 39.6%

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 20:29:17 -07:00
Steve Yegge
fae597c4f5 Bump version to 0.21.0
Amp-Thread-ID: https://ampcode.com/threads/T-a9a67394-37ca-4b79-aa23-c5c011f9c0cd
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 20:21:15 -07:00
Steve Yegge
8cbcde134a Make event-driven mode the default
Event-driven daemon is now production-ready after hardening fixes in
commit 349b892. Making it the default for v0.21.0.

Users can still opt back to polling mode with BEADS_DAEMON_MODE=poll
if needed.

Benefits:
- <500ms sync latency (vs 5000ms with polling)
- ~60% less CPU usage
- Instant reactivity to mutations and file changes
- Fallback polling when file watcher unavailable

Amp-Thread-ID: https://ampcode.com/threads/T-a9a67394-37ca-4b79-aa23-c5c011f9c0cd
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 20:20:44 -07:00
Steve Yegge
349b892123 Harden event-driven daemon for production
Three critical fixes to make event-driven mode production-ready:

1. Skip redundant imports: Check JSONL mtime vs DB mtime to avoid
   self-triggered import loops after export writes JSONL

2. Add server.Stop() in serverErrChan case: Ensures clean RPC
   server shutdown on errors

3. Fallback ticker (60s): When file watcher unavailable (e.g., network
   filesystems), fall back to periodic polling to detect remote changes

These minimal fixes address Oracle's concerns without over-engineering.
Event-driven mode is now safe for default.

Amp-Thread-ID: https://ampcode.com/threads/T-a9a67394-37ca-4b79-aa23-c5c011f9c0cd
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 20:18:05 -07:00
Steve Yegge
7d73082d7e Fix duplicate pollution: filter closed issues from detection
- Closed issues no longer appear in duplicate scans
- Prevents infinite reappearance of merged duplicates
- Deleted 29 low-value closed issues to shrink DB
- Closes bd-c577

Amp-Thread-ID: https://ampcode.com/threads/T-51165824-9559-4696-919f-2c40459d5ef9
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 19:51:44 -07:00
Steve Yegge
76069a09dc Improve cmd/bd test coverage from 21% to 23.1% (bd-27ea)
Added comprehensive tests for:
- validate.go (parseChecks, validation results, orphaned deps, duplicates, git conflicts)
- restore.go (readIssueFromJSONL, git helpers)
- sync.go (git helpers, JSONL counting)

Progress: 21.0% → 23.1% (+2.1%)
Target: 40% (multi-session effort)
Amp-Thread-ID: https://ampcode.com/threads/T-540ebf64-e14f-4541-b098-586d2b07dc3e
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 19:44:43 -07:00
Steve Yegge
1cc1e6615c Code review improvements to bd validate
Based on oracle feedback:
- Add parseChecks() helper for check normalization and validation
  - Supports synonyms: dupes→duplicates, git-conflicts→conflicts
  - Case-insensitive, whitespace-tolerant parsing
  - Deduplicates repeated checks while preserving order
  - Returns error for unknown checks (exit code 2)

- Fix JSON output robustness
  - Serialize errors as strings, not objects
  - Add 'failed' boolean per check
  - Fix 'healthy' to include error state

- Improve error handling
  - hasFailures() now includes check errors
  - Exit code 1 for any failures (issues or errors)
  - Exit code 2 for usage errors (invalid checks)

- Optimize database access
  - Single SearchIssues() call shared across checks
  - Only fetch if needed (orphans/duplicates/pollution)

- Stabilize output ordering
  - Print checks in deterministic order (not map iteration)
  - Use result.name for display labels

- Better UX
  - Unknown checks fail fast with helpful message
  - Deterministic output for CI/scripting
  - More robust JSON for machine consumption
2025-10-31 19:37:18 -07:00
Steve Yegge
e2bb4311f1 Improve mutation channel robustness
- Add event type constants (MutationCreate, MutationUpdate, MutationDelete, MutationComment)
- Make buffer size configurable via BEADS_MUTATION_BUFFER (default 512, up from 100)
- Add defensive closed-channel handling in event loop consumer
- Add 1s dropped-events ticker (down from 60s) for faster recovery
- Verify mutationChan is never closed (prevents panic)

Oracle review findings addressed:
- Eliminates panic risk from send-on-closed-channel
- Reduces worst-case recovery latency from 60s to 1s
- Increases buffer capacity for better burst handling
- Type-safe event constants prevent string typos

Related: bd-36320a04, bd-1f4086c5
2025-10-31 19:12:02 -07:00
Steve Yegge
e313e6e2c2 Improve test coverage for cmd/bd
- Add comprehensive version mismatch tests (checkVersionMismatch: 25% → 100%)
- Add daemon formatting helper tests (formatDaemonDuration, formatDaemonRelativeTime: 0% → 100%)
- Add auto-import test cases (checkAndAutoImport: 27.8% → 44.4%)
- Add compact eligibility test

Overall coverage: 47.9% → 48.3%
cmd/bd coverage: 20.5% → 21.0%

New test files:
- cmd/bd/autoflush_version_test.go (5 test functions)
- cmd/bd/daemons_test.go (2 test functions)

All tests passing.

Amp-Thread-ID: https://ampcode.com/threads/T-29fa5379-fd71-4f75-bc4f-272beff96c8f
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 18:40:32 -07:00
Steve Yegge
7ad15fe524 Fix #188: Add --json flag to blocked command
- Added --json flag registration for blockedCmd
- Fixed blockedCmd to read json flag from cmd.Flags()
- All commands now consistently support --json for agent use
- Completes the fix started in earlier commits for show/update/close/stats
2025-10-31 18:15:13 -07:00
Steve Yegge
fa1d13af11 Fix #190: Clarify onboarding completion message
Changed 'confirm by saying' to 'tell your AI assistant' to make it clear
this is meant for the AI, not a bd command to run.
2025-10-31 18:12:40 -07:00
Steve Yegge
4d2efdc7b3 test: add autoimport and utility function tests
- Test checkAndAutoImport with various conditions
- Test findBeadsDir and findBeadsDir in parent
- Test checkGitForIssues edge cases
- Test boolToFlag utility function
- cmd/bd coverage: 20.4% -> 20.5%
2025-10-31 18:04:29 -07:00
Steve Yegge
caf0161ed1 Add unit tests for nodb.go and daemon/discovery.go
- Added tests for extractIssuePrefix, loadIssuesFromJSONL, detectPrefix, writeIssuesToJSONL
- Added tests for walkWithDepth depth limiting and hidden directory skipping
- Added tests for DiscoverDaemons registry and legacy discovery paths
- Improved test coverage for cmd/bd and internal/daemon
2025-10-31 17:26:37 -07:00
Steve Yegge
8bf6b1eb63 Add unit tests for autoimport, importer, and main CLI
Amp-Thread-ID: https://ampcode.com/threads/T-b89cad6b-636f-477f-925d-4c3e3f769215
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 17:17:33 -07:00
Steve Yegge
39d5608497 Merge branch 'main' of github.com:steveyegge/beads
# Conflicts:
#	.beads/beads.jsonl
2025-10-31 15:12:08 -07:00
Steve Yegge
ddab26315f Remove dead code found by deadcode analyzer
- Removed 5 unreachable functions (~200 LOC)
- computeIssueContentHash, shouldSkipExport from autoflush.go
- addDependencyUnchecked, removeDependencyIfExists from dependencies.go
- isUniqueConstraintError alias from util.go
- All tests still pass
- Closes bd-7c5915ae
2025-10-31 15:12:01 -07:00
Steve Yegge
aa567f6b9a feat: add Mermaid.js format for dependency tree visualization (#191)
Adds `bd dep tree --format mermaid` to export dependency trees as Mermaid.js flowcharts.

Features:
- Status indicators: ☐ open, ◧ in_progress, ⚠ blocked, ☑ closed
- Theme-agnostic design
- Works with --reverse flag
- Comprehensive unit tests following TDD

Co-authored-by: David Laing <david@davidlaing.com>
2025-10-31 15:11:29 -07:00
Steve Yegge
118d7541dd Add --json flag support to more bd commands
- stats: Added --json flag for programmatic output
- show, update: Added --json flag for issue details
- close, reopen: Added --json flag for bulk operations
- dep (add, remove, tree, cycles): Added --json flags
- label (add, remove, list, list-all): Added --json flags
- duplicates, merge: Added --json flags

Closes bd-4dcd2d09
2025-10-31 14:36:20 -07:00
Steve Yegge
d5488cb97f Remove collision-era language from docs and code
- Updated FAQ.md, ADVANCED.md, TROUBLESHOOTING.md to explain hash IDs eliminate collisions
- Removed --resolve-collisions references from all documentation and examples
- Renamed handleCollisions() to detectUpdates() to reflect update semantics
- Updated test names: TestAutoImportWithCollision → TestAutoImportWithUpdate
- Clarified: with hash IDs, same-ID = update operation, not collision

Closes: bd-50a7, bd-b84f, bd-bda8, bd-650c, bd-3ef2, bd-c083, bd-85a6
2025-10-31 14:24:50 -07:00
Ryan
08bfe133d0 Add 'bd doctor' command to sanity check installation (#189)
* Add bd doctor command for installation health checks

Implements a comprehensive health check command similar to claude doctor
that validates beads installation and provides actionable recommendations.

Features:
- Installation check (.beads/ directory exists)
- Database version verification (compares with CLI version)
- ID format detection (hash-based vs sequential)
- CLI version check (fetches latest from GitHub)
- Storage type detection (SQLite vs JSONL-only mode)
- Tree-style output with color-coded warnings
- JSON output for scripting (--json flag)
- Actionable fix recommendations for each issue

Implementation improvements:
- Status constants instead of magic strings
- Semantic version comparison (fixes 0.10.0 vs 0.9.9 edge case)
- Documented defer pattern for intentional error ignore
- Comprehensive test coverage including version comparison edge cases
- Clean integration using slices.Contains for command list

Usage:
  bd doctor              # Check current directory
  bd doctor /path/to/repo # Check specific repository
  bd doctor --json       # Machine-readable output

* Simplify bd doctor documentation in README

Reduce verbose health check section to 2 lines as requested.

* Fix bd doctor to handle JSONL-only mode for ID format check

When no SQLite database exists (JSONL-only mode), skip the ID format
check instead of showing an error. This prevents the confusing
'Unable to query issues' error when the installation is actually fine.
2025-10-31 11:41:13 -07:00
Steve Yegge
a5be0d13bf Version bump to 0.20.1: Hash-based IDs
- Bump version across all components (CLI, plugin, MCP server)
- Update CHANGELOG.md with comprehensive hash ID migration notes
- Replace critical multi-clone warning with hash ID announcement
- Add Hash-Based Issue IDs section to README with:
  - ID format explanation (4/5/6 char progressive scaling)
  - Why hash IDs solve collision issues
  - Birthday paradox collision probability math
  - Migration instructions
- Update all examples to use hash IDs (bd-a1b2) instead of sequential (bd-1)

Breaking changes:
- Sequential ID generation removed (bd-c7af, bd-8e05, bd-4c74)
- issue_counters table removed from schema
- --resolve-collisions flag removed (no longer needed)

Migration: Run 'bd migrate' to upgrade database schema
Amp-Thread-ID: https://ampcode.com/threads/T-0b000145-350a-4dfe-a3f1-67d4d52a6717
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 01:47:54 -07:00