Commit Graph

102 Commits

Author SHA1 Message Date
Steve Yegge
6e8b4b8f19 Add devcontainer configuration for automatic bd setup
- Create .devcontainer/devcontainer.json with Go 1.23 environment
- Add setup.sh to build bd from source and install git hooks
- Add devcontainer README with documentation
- Update main README to mention devcontainer support
- Resolves bd-ry1u and GitHub issue #229
2025-11-05 15:09:48 -08:00
Steve Yegge
0875e50f85 docs: Document new bd list query facilities (pattern matching, date ranges, empty checks)
Amp-Thread-ID: https://ampcode.com/threads/T-4d8dfaab-6a44-4ee5-ad11-93b915bbe1dc
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 01:02:55 -08:00
Steve Yegge
fbe790aa40 feat: Add ancestor_id field and implement epic/child filtering
Amp-Thread-ID: https://ampcode.com/threads/T-22f7d7c5-6f7b-4783-beda-8494360d887a
Co-authored-by: Amp <amp@ampcode.com>
2025-11-05 00:44:41 -08:00
Steve Yegge
cac9ae6647 Add routing integration tests and documentation
- Created routing_integration_test.go with comprehensive routing tests
- Tests cover maintainer/contributor detection, explicit overrides, end-to-end multi-repo
- Added docs/ROUTING.md documenting auto-routing feature
- Closed bd-6u6g, bd-zmi5, bd-nzt4, bd-btsm (routing tests)
- Updated bd-4ms and bd-8hf with progress notes

All routing tests pass. Multi-repo auto-routing is complete.

Amp-Thread-ID: https://ampcode.com/threads/T-2ea8b2ed-ceb7-432e-91f1-1f527b0e7b4d
Co-authored-by: Amp <amp@ampcode.com>
2025-11-04 23:12:42 -08:00
Steve Yegge
eb434dd08c Add template support for issue creation (bd-164b)
- Built-in templates: epic, bug, feature (embedded in binary)
- Custom templates in .beads/templates/ (override built-ins)
- Commands: bd template list/show/create
- Flag: bd create --from-template <name> "Title"
- Template fields: description, type, priority, labels, design, acceptance
- Security: sanitize template names to prevent path traversal
- Flag precedence: explicit flags override template defaults
- Tests: template loading, security, flag precedence
- Docs: commands/template.md and README.md updated

Closes bd-164b

Amp-Thread-ID: https://ampcode.com/threads/T-118fe54f-b112-4f99-a3d9-b7df53fb7284
Co-authored-by: Amp <amp@ampcode.com>
2025-11-03 20:31:11 -08:00
Steve Yegge
a58f5b4509 Merge wasm-port-bd-44d0: Add npm package with native binaries
Merges complete npm package implementation for @beads/bd.

Features:
- npm package wrapping native bd binaries
- Automatic platform-specific binary download
- Claude Code for Web integration via SessionStart hooks
- Comprehensive integration test suite (5 tests, all passing)
- Complete documentation (6 guides)
- Release process documentation

Published to npm: https://www.npmjs.com/package/@beads/bd

Benefits over WASM:
- Full SQLite support (native vs custom VFS)
- Better performance
- Simpler implementation and maintenance
- 100% feature parity with standalone bd

Closes bd-febc
2025-11-03 12:08:39 -08:00
Steve Yegge
da921e1829 Add npm package for bd with native binaries (bd-febc)
Implements @beads/bd npm package for easy installation in Node.js
environments, especially Claude Code for Web.

Features:
- Automatic platform-specific binary download during postinstall
- CLI wrapper that invokes native bd binary
- Full feature parity with standalone bd
- Works with SessionStart hooks for auto-installation

Package structure:
- bin/bd.js: Node.js CLI wrapper
- scripts/postinstall.js: Downloads correct binary from GitHub releases
- scripts/test.js: Verification tests
- Comprehensive documentation (6 guides)

Published to npm: https://www.npmjs.com/package/@beads/bd

Benefits vs WASM:
- Full SQLite support (no custom VFS)
- Better performance (native vs WASM)
- Simpler implementation and maintenance
- All commands work identically

Closes bd-febc, bd-be7a, bd-e2e6, bd-f282, bd-87a0, bd-b54c

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 11:41:18 -08:00
Steve Yegge
edf1f71fa7 Add comprehensive protected branch workflow documentation (bd-5ce8)
Created complete documentation suite for using beads with protected branches:

1. **docs/PROTECTED_BRANCHES.md** - Comprehensive 600+ line guide covering:
   - Quick start and setup
   - How git worktrees work
   - Daily workflow for agents and humans
   - Merging strategies (PR and direct)
   - Troubleshooting common issues
   - Platform-specific notes (GitHub, GitLab, Bitbucket)
   - Advanced topics (CI/CD, multi-clone sync, etc.)

2. **AGENTS.md** - Added "Protected Branch Workflow" section:
   - Quick reference for agents
   - No changes needed to agent workflows
   - Commands for setup and merging
   - Link to detailed docs

3. **README.md** - Updated with:
   - Protected branch support feature flag
   - Quick start instructions with --branch flag
   - Link to comprehensive guide

4. **examples/protected-branch/** - Working example with:
   - Step-by-step demo
   - Multi-clone sync workflow
   - GitHub Actions integration example
   - Directory structure explanation
   - Troubleshooting tips

All commands verified:
- bd init --branch <name>
- bd config get/set sync.branch
- bd sync --status
- bd sync --merge

Documentation is platform-agnostic and works with GitHub, GitLab,
Bitbucket, or any git platform with branch protection.

Closes bd-5ce8

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 18:41:51 -08:00
Steve Yegge
38bdd3e251 Document migration inspection commands in user docs
- Add bd migrate --inspect and bd info --schema examples to README.md
- Update QUICKSTART.md migration section with AI agent workflow
- Expand AGENTS.md with migration safety invariants explanation
- Clarify when and why to use inspection before migrating

Makes the new AI-supervised migration features discoverable.

Amp-Thread-ID: https://ampcode.com/threads/T-de7e1141-87ac-4b4a-9cea-1b7bc4d51da9
Co-authored-by: Amp <amp@ampcode.com>
2025-11-02 14:18:32 -08:00
Steve Yegge
932b293118 Document hash-based IDs and hierarchical children (bd-a5e2bd80.15)
Amp-Thread-ID: https://ampcode.com/threads/T-afcbc67c-4b83-47d4-8361-7c1ad08906a0
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 12:51:10 -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
Steve Yegge
db6dd403ba Add critical warning: solo workflows only until 1.0.0 2025-10-29 23:50:04 -07:00
Steve Yegge
9a109902b4 Consolidate documentation: move maintainer docs to docs/, remove redundant files
- Move RELEASING.md and LINTING.md to docs/ (maintainer-only content)
- Delete WORKFLOW.md (agent workflow content belongs in AGENTS.md)
- Delete TEXT_FORMATS.md (technical details belong in ADVANCED.md)
- Update all cross-references to point to new locations
- Keep CLAUDE.md (required by Claude Code)

Reduces root-level docs from 20 to 16 files with clearer organization.

Amp-Thread-ID: https://ampcode.com/threads/T-fe1db4f3-16c6-4a79-8887-c7f4c1f11c43
Co-authored-by: Amp <amp@ampcode.com>
2025-10-28 15:46:12 -07:00
Steve Yegge
4e38626361 Document bd daemons commands (bd-150)
Amp-Thread-ID: https://ampcode.com/threads/T-f1cff202-188b-4850-a909-c2750d24ad22
Co-authored-by: Amp <amp@ampcode.com>
2025-10-26 19:03:03 -07:00
Steve Yegge
ec7d824897 Fix bd init --quiet and clarify agent usage in docs
- Fix: bd init --quiet now skips interactive prompts and auto-installs hooks
- Docs: Add Git Workflow & Auto-Sync section to README
- Docs: Update AGENTS.md with --quiet flag guidance for agents
- Docs: Update WORKFLOW.md to explain auto-import after git pull
- Docs: Add FAQ entries about auto-sync behavior and who runs init
- Closes bd-127, bd-140, bd-141

Amp-Thread-ID: https://ampcode.com/threads/T-72f55d41-f16c-4541-b72a-8acc9013e87b
Co-authored-by: Amp <amp@ampcode.com>
2025-10-26 12:53:50 -07:00
Steve Yegge
09c11a26e6 Add configurable sort policy for GetReadyWork (bd-147)
- Add SortPolicy type with hybrid, priority, oldest constants
- Add SortPolicy field to WorkFilter
- Implement buildOrderByClause() for SQL generation
- Add --sort flag to bd ready command
- Add comprehensive tests for all 3 sort policies
- Update RPC protocol to support sort policy
- Update documentation with sort policy examples

Enables autonomous systems like VC to use strict priority ordering
while preserving hybrid behavior for interactive use.

Amp-Thread-ID: https://ampcode.com/threads/T-9d7ea9db-8d6d-4498-9daa-48a7e104ce1f
Co-authored-by: Amp <amp@ampcode.com>
2025-10-25 18:54:00 -07:00
Steve Yegge
c2056152e6 Add bd info command to show database path and daemon status
Implements bd-145. Users can now easily determine which database file bd is using
and check daemon connection status.

Features:
- Shows absolute database path
- Displays daemon status (connected/mode/health/version)
- Shows issue count
- Supports --json output for programmatic use
- Works in both daemon and direct modes

Example output:
  bd info                    # Human-readable
  bd info --json             # JSON for agents
  bd info --no-daemon        # Force direct mode

Updated documentation in README.md and AGENTS.md.

Amp-Thread-ID: https://ampcode.com/threads/T-a33c0762-f800-4fea-9510-6a803d8aece8
Co-authored-by: Amp <amp@ampcode.com>
2025-10-25 16:43:44 -07:00
Steve Yegge
1a9258ce4f Remove deprecated bd repos command
Amp-Thread-ID: https://ampcode.com/threads/T-3fe46a3f-979f-48dd-9bb3-ee0b9fde46c2
Co-authored-by: Amp <amp@ampcode.com>
2025-10-24 19:49:16 -07:00
Steve Yegge
72d16229e0 feat: Add Dependabot config and README badges
- Add Dependabot for Go modules, GitHub Actions, and Python dependencies
- Add badges: Go version, release, CI status, Go Report Card, license, PyPI
- Weekly automated security and dependency updates

Amp-Thread-ID: https://ampcode.com/threads/T-ea1982a4-56dc-482a-8c00-00963623cd64
Co-authored-by: Amp <amp@ampcode.com>
2025-10-23 20:06:40 -07:00
Steve Yegge
80dc536256 Add Beadster to Community & Ecosystem section
- Native macOS app by @podviaznikov
- Provides multi-project issue visualization
- Addresses #117
2025-10-23 17:09:23 -07:00
Steve Yegge
2455a856e1 Refactor documentation: condense README and create specialized docs
- Reduce README from 1000 to ~400 lines, focusing on core features
- Create INSTALLING.md with all installation methods and platform details
- Create ADVANCED.md with prefix renaming, merging, global daemon, worktrees
- Create TROUBLESHOOTING.md with all common issues and solutions
- Create FAQ.md with frequently asked questions
- Add cross-links between all documentation files
- Improve discoverability with organized topic-specific guides

Amp-Thread-ID: https://ampcode.com/threads/T-8e2b3099-beb9-492a-9781-0e3da9fa9ba8
Co-authored-by: Amp <amp@ampcode.com>
2025-10-23 17:03:27 -07:00
Steve Yegge
bd139161c3 docs: Expand 'Why not GitHub Issues' FAQ section
- Add 6 key differentiators with detailed comparisons
- Highlight typed dependencies, ready-work detection, git-first architecture
- Credit GH Issues strengths for human teams
- Link to GH issue #125 for full analysis

Addresses community question from @askpatrickw
2025-10-23 16:47:49 -07:00
Steve Yegge
e8eb0cb6ae Add bd config command for external integration configuration
- Add GetAllConfig/DeleteConfig methods to storage interface
- Implement config set/get/list/unset subcommands with JSON support
- Add comprehensive tests for config operations
- Create CONFIG.md with full documentation and examples
- Update README.md with config section
- Support namespace conventions (jira.*, linear.*, github.*, custom.*)

Closes bd-60

Amp-Thread-ID: https://ampcode.com/threads/T-33db7481-de7c-475e-b562-6afb7fb4bc7a
Co-authored-by: Amp <amp@ampcode.com>
2025-10-23 14:14:22 -07:00
Steve Yegge
5a6177b4bc Fix bd-73: Add git worktree detection and warnings
- Implement robust worktree detection using git-dir vs git-common-dir comparison
- Add prominent warning when daemon mode is active in a worktree
- Warn in 3 places: initial connection, auto-start, and daemon start command
- Show shared database path and clarify BEADS_AUTO_START_DAEMON behavior
- Document limitations and solutions in README.md and AGENTS.md
- Add comprehensive tests for detection and path truncation

Fixes #55

Amp-Thread-ID: https://ampcode.com/threads/T-254eb9e3-1a42-42d7-afdf-b7ca2d2dcb8b
Co-authored-by: Amp <amp@ampcode.com>
2025-10-22 23:05:00 -07:00
Steve Yegge
5e7b3aa43a Add Beads library API for Go integration
Expose full Storage interface and all types through public beads.go API,
enabling external Go projects (like VC) to import Beads directly instead
of spawning CLI processes.

Changes:
- Expanded beads.go with all public types (Issue, Dependency, Comment, etc.)
- Added all constants (Status, IssueType, DependencyType, EventType)
- Created comprehensive integration tests (beads_integration_test.go)
- Added library usage example at examples/library-usage/
- Documented library integration in README.md

Test coverage: 96.4% on public API, 14 integration tests, all passing.

Closes bd-58, bd-59

Amp-Thread-ID: https://ampcode.com/threads/T-f0093c79-7422-45e2-b0ed-0ddfebc9ffea
Co-authored-by: Amp <amp@ampcode.com>
2025-10-22 15:49:40 -07:00
Steve Yegge
e291f464ee Fix bd-54: Prevent multiple daemon instances via file locking
- Implemented daemon.lock using flock (Unix) and LockFileEx (Windows)
- Lock acquired before PID file, held for daemon lifetime
- Eliminates race conditions in concurrent daemon starts
- Backward compatible: falls back to PID check for old daemons
- Updated isDaemonRunning() to check lock availability
- All tests pass including new lock and backward compatibility tests

Amp-Thread-ID: https://ampcode.com/threads/T-0e2627f4-03f9-4024-bb4b-21d23d296300
Co-authored-by: Amp <amp@ampcode.com>
2025-10-22 13:59:58 -07:00
Steve Yegge
4ef995b0e4 Document merge command and AI duplicate detection workflow (bd-29)
- Add comprehensive merge command documentation to README.md
- Add AI agent duplicate detection workflow to AGENTS.md
- Include command syntax, examples, and best practices
- Close bd-29

Amp-Thread-ID: https://ampcode.com/threads/T-95a37593-fd67-4e99-bc84-ace580b4776d
Co-authored-by: Amp <amp@ampcode.com>
2025-10-22 11:48:12 -07:00
Steve Yegge
a578e16de3 Remove critical warning banners - issues fixed in 0.11.0 2025-10-22 01:22:59 -07:00
Steve Yegge
aba982f785 Update issues.jsonl and documentation
Amp-Thread-ID: https://ampcode.com/threads/T-fea21f01-c136-437f-a61f-226872ae7a38
Co-authored-by: Amp <amp@ampcode.com>
2025-10-21 20:29:10 -07:00
Steve Yegge
a86f3e139e Add native Windows support (#91)
- Native Windows daemon using TCP loopback endpoints
- Direct-mode fallback for CLI/daemon compatibility
- Comment operations over RPC
- PowerShell installer script
- Go 1.24 requirement
- Cross-OS testing documented

Co-authored-by: danshapiro <danshapiro@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-c6230265-055f-4af1-9712-4481061886db
Co-authored-by: Amp <amp@ampcode.com>
2025-10-20 21:08:49 -07:00
Steve Yegge
e10e34b221 Add agent-first 'bd onboard' command (bd-173)
- Refactor bd onboard to output instructions instead of doing string replacement
- Leverage agent intelligence to naturally integrate bd into documentation
- Bootstrap via 'BEFORE ANYTHING ELSE: run bd onboard' in AGENTS.md
- Agent receives formatted instructions to update AGENTS.md and CLAUDE.md
- More agentic approach - adapts to existing project structure
- Update README with new bootstrap workflow

Amp-Thread-ID: https://ampcode.com/threads/T-d70fd1bf-8d44-48b6-bb55-5ae49efb23b8
Co-authored-by: Amp <amp@ampcode.com>
2025-10-20 15:04:33 -07:00
Steve Yegge
ec9570c045 chore: Bump version to 0.9.11
Updated all component versions:
- bd CLI: 0.9.10 → 0.9.11
- Plugin: 0.9.10 → 0.9.11
- MCP server: 0.9.10 → 0.9.11
- Documentation: 0.9.10 → 0.9.11

Generated by scripts/bump-version.sh
2025-10-19 23:23:39 -07:00
Steve Yegge
24cd163afb Add comprehensive label documentation (bd-159, bd-163)
- Create LABELS.md with complete guide to label system
- Document label patterns, filtering, workflows, and best practices
- Add Labels section to README with examples
- Link LABELS.md in documentation section
- Close bd-159 and bd-163

Amp-Thread-ID: https://ampcode.com/threads/T-072304c3-3a03-4091-92a9-9e16b4538227
Co-authored-by: Amp <amp@ampcode.com>
2025-10-19 23:11:52 -07:00
Steve Yegge
422c102f46 Add label filtering to bd list with AND/OR semantics
- Add --label flag for AND filtering (must have ALL labels)
- Add --label-any flag for OR filtering (must have AT LEAST ONE label)
- Add normalizeLabels() helper to trim, dedupe, and clean inputs
- Fix RPC title filtering parity bug (forward via Query field)
- Add comprehensive tests for label filtering including combined AND+OR
- Update documentation in README and CHANGELOG
- Improve flag help text to clarify combined semantics

Closes bd-161
2025-10-19 23:03:02 -07:00
Steve Yegge
34cf361b2b Add telemetry and observability to daemon (bd-153)
Implement comprehensive metrics collection for the daemon with zero-overhead design:

Features:
- Request metrics: counts, latency percentiles (p50, p95, p99), error rates
- Cache metrics: hit/miss ratios, eviction counts, database connections
- Connection metrics: total, active, rejected connections
- System metrics: memory usage, goroutine count, uptime

Implementation:
- New internal/rpc/metrics.go with Metrics collector
- OpMetrics RPC operation for programmatic access
- 'bd daemon --metrics' command (human-readable and JSON output)
- Lock-free atomic operations for cache/connection metrics
- Copy-and-compute pattern in Snapshot to minimize lock contention
- Deferred metrics recording ensures all requests are tracked

Improvements from code review:
- JSON types use float64 for ms/seconds (not time.Duration)
- Snapshot copies data under short lock, computes outside
- Union of operations from counts and errors maps
- Defensive clamping in percentile calculation
- Defer pattern ensures metrics recorded even on early returns

Documentation updated in README.md with usage examples.

Closes bd-153

Amp-Thread-ID: https://ampcode.com/threads/T-20213187-65c7-47f7-ba21-5234c9e52e26
Co-authored-by: Amp <amp@ampcode.com>
2025-10-19 15:55:55 -07:00
Marco Del Pin
f621e80dc3 Restore install.sh to scripts/ directory and update README (#84)
- Restore install.sh (249 lines) from commit b8bcffb^ to scripts/ directory
- Update README.md to reference scripts/install.sh in installation instructions
- Fix 404 error for users following quick installation guide

The install.sh script was accidentally deleted in commit b8bcffb (2025-10-17)
during directory reorganization. This restores it to the new scripts/ directory
as intended by the reorganization.
2025-10-19 09:41:42 -07:00
Steve Yegge
b0fba2eef2 feat: implement --max-depth flag for bd dep tree (closes #87, bd-3, bd-159)
- Add --max-depth/-d flag with default of 50
- Wire flag through to store.GetDependencyTree()
- Add input validation (must be >= 1)
- Show inline '… [truncated]' markers on truncated nodes
- Update truncation warning to show actual depth used
- Add comprehensive tests (truncation, default depth, boundary cases)
- Update CLI docs and reference

Thanks to @yashwanth-reddy909 for the initial implementation in PR #87.
This commit completes the feature with full wiring, validation, tests, and docs.

Amp-Thread-ID: https://ampcode.com/threads/T-c439b09c-cff2-48d9-8988-cf9353f0d32e
Co-authored-by: Amp <amp@ampcode.com>
2025-10-19 09:00:11 -07:00
Steve Yegge
22daa12665 Add daemon fallback visibility and version compatibility checks
Implemented bd-150: Improve daemon fallback visibility and user feedback
- Added DaemonStatus struct to track connection state
- Enhanced BD_DEBUG logging with detailed diagnostics and timing
- Added BD_VERBOSE mode with actionable warnings when falling back
- Implemented health checks before using daemon
- Clear fallback reasons: connect_failed, health_failed, auto_start_disabled, auto_start_failed, flag_no_daemon
- Updated documentation

Implemented bd-151: Add version compatibility checks for daemon RPC protocol
- Added ClientVersion field to RPC Request struct
- Client sends version (0.9.10) in all requests
- Server validates version compatibility using semver:
  - Major version must match
  - Daemon >= client for backward compatibility
  - Clear error messages with directional hints (upgrade daemon vs upgrade client)
- Added ClientVersion and Compatible fields to HealthResponse
- Implemented 'bd version --daemon' command to check compatibility
- Fixed batch operations to propagate ClientVersion for proper checks
- Updated documentation with version compatibility section

Code review improvements:
- Propagate ClientVersion in batch sub-requests
- Directional error messages based on which side is older
- Made ServerVersion a var for future unification

Amp-Thread-ID: https://ampcode.com/threads/T-b5fe36b8-c065-44a9-a55b-582573671609
Co-authored-by: Amp <amp@ampcode.com>
2025-10-19 08:04:48 -07:00
Steve Yegge
cff10b1998 Add automatic log rotation for daemon (bd-154)
- Integrated lumberjack library for production-ready log rotation
- Configurable via env vars: BEADS_DAEMON_LOG_MAX_SIZE, BEADS_DAEMON_LOG_MAX_BACKUPS, BEADS_DAEMON_LOG_MAX_AGE, BEADS_DAEMON_LOG_COMPRESS
- Defaults: 10MB max size, 3 backups, 7 day retention, compression enabled
- Added comprehensive tests for env var parsing and rotation config
- Updated README.md and CHANGELOG.md with rotation documentation
- Prevents unbounded log growth for long-running daemons

Amp-Thread-ID: https://ampcode.com/threads/T-8232d41a-6872-4f4c-962c-7fae8f5e83b7
Co-authored-by: Amp <amp@ampcode.com>
2025-10-18 16:30:19 -07:00
Steve Yegge
8f80dde0ad Add global daemon auto-start support (bd-149)
- Implement shouldUseGlobalDaemon() with multi-repo detection
- Auto-detect 4+ beads repos and prefer global daemon
- Support BEADS_PREFER_GLOBAL_DAEMON env var for explicit control
- Add 'bd daemon --migrate-to-global' migration helper
- Update auto-start logic to use global daemon when appropriate
- Update documentation in AGENTS.md and README.md

Amp-Thread-ID: https://ampcode.com/threads/T-9af9372d-f3f3-4698-920d-e5ad1486d849
Co-authored-by: Amp <amp@ampcode.com>
2025-10-18 16:09:55 -07:00
Steve Yegge
fb9b5864af feat: Add bd repos multi-repo commands and fix bd ready for in_progress issues
- Add 'bd repos' command for multi-repository management (bd-123)
  - bd repos list: show all cached repositories
  - bd repos ready: aggregate ready work across repos
  - bd repos stats: combined statistics across repos
  - bd repos clear-cache: clear repository cache
  - Requires global daemon (bd daemon --global)

- Fix bd ready to show in_progress issues (bd-165)
  - bd ready now shows both 'open' and 'in_progress' issues with no blockers
  - Allows epics/tasks ready to close to appear in ready work
  - Critical P0 bug fix for workflow

- Apply code review improvements to repos implementation
  - Use strongly typed RPC responses (remove interface{})
  - Fix clear-cache lock handling (close connections outside lock)
  - Add error collection for per-repo failures
  - Add context timeouts (1-2s) to prevent hangs
  - Add lock strategy comments

- Update documentation (README.md, AGENTS.md)
- Add comprehensive tests for both features

Amp-Thread-ID: https://ampcode.com/threads/T-1de989a1-1890-492c-9847-a34144259e0f
Co-authored-by: Amp <amp@ampcode.com>
2025-10-18 00:37:27 -07:00
Steve Yegge
9fb46d41b8 Implement daemon auto-start with comprehensive improvements (bd-124)
- Auto-starts daemon on first bd command (unless --no-daemon or BEADS_AUTO_START_DAEMON=false)
- Exponential backoff on failures: 5s, 10s, 20s, 40s, 80s, 120s (max)
- Lockfile prevents race conditions when multiple commands start daemon simultaneously
- Stdio redirected to /dev/null to prevent daemon output in foreground
- Uses os.Executable() for security (prevents PATH hijacking)
- Socket readiness verified with actual connection test
- Accepts multiple falsy values: false, 0, no, off (case-insensitive)
- Working directory set to database directory for local daemon context
- Comprehensive test coverage including backoff math and concurrent starts

Fixes:
- Closes bd-1 (won't fix - compaction keeps DBs small)
- Closes bd-124 (daemon auto-start implemented)

Documentation updated in README.md and AGENTS.md

Amp-Thread-ID: https://ampcode.com/threads/T-b10fe866-ab85-417f-9c4c-5d1f044c5796
Co-authored-by: Amp <amp@ampcode.com>
2025-10-17 23:42:57 -07:00
Steve Yegge
0795797bac docs: Document multi-repo workflow with global daemon
Implements bd-122: Document how to use beads across multiple projects

Added comprehensive multi-repo documentation:
- README.md: Global daemon section with architecture diagram
- AGENTS.md: MCP multi-repo configuration (global daemon + per-project)
- integrations/beads-mcp/README.md: BEADS_WORKING_DIR usage
- Mermaid diagram showing one daemon serving multiple repos

Documentation covers:
- Global daemon (bd daemon --global) for system-wide usage
- Per-project MCP instances with BEADS_WORKING_DIR
- Comparison table (local vs global)
- When to use each approach
- Example workflows for multi-project setups

Benefits of global daemon:
- One daemon process for all repos
- Automatic socket discovery (local -> global fallback)
- Better resource usage
- Per-request context routing to correct database

Amp-Thread-ID: https://ampcode.com/threads/T-ea606216-b886-4af0-bba8-56d000362d01
Co-authored-by: Amp <amp@ampcode.com>
2025-10-17 22:49:22 -07:00
Steve Yegge
ee94d817ed feat: Add batch deletion support (bd-127)
- Add DeleteIssues() method in sqlite.go for atomic batch deletion
- Support multiple issue IDs as arguments or from file
- Add --from-file flag to read IDs from file (supports comments)
- Add --dry-run mode for safe preview without deleting
- Add --cascade flag for recursive deletion of dependents
- Add --force flag to orphan dependents instead of failing
- Pre-collect connected issues before deletion for text reference updates
- Add orphan deduplication to prevent duplicate IDs
- Add rows.Err() checks in all row iteration loops
- Full transaction safety - all deletions succeed or none do
- Comprehensive statistics tracking (deleted, dependencies, labels, events)
- Update README and CHANGELOG with batch deletion docs

Fixed critical code review issues:
- Dry-run mode now properly uses dryRun parameter instead of deleting data
- Text references are pre-collected before deletion so they update correctly
- Added orphan deduplication and error checks
- Updated defer rollback pattern per Go best practices
2025-10-17 21:13:23 -07:00
Steve Yegge
52e2993bf6 chore: Bump version to 0.9.10
Updated all component versions:
- bd CLI: 0.9.9 → 0.9.10
- Plugin: 0.9.9 → 0.9.10
- MCP server: 0.9.9 → 0.9.10
- Documentation: 0.9.9 → 0.9.10

Generated by scripts/bump-version.sh
2025-10-17 18:15:29 -07:00
Steve Yegge
4ce33efa81 Update MCP server warning to clarify bd binary works for multi-repo 2025-10-17 14:34:09 -07:00
Ben Madore
789145f842 Add .gitignore to .beads directory during init (#64)
- Create .gitignore file in .beads/ when running bd init
    - Ignores *.db and *.db-* patterns to prevent database commits
    - Add test coverage to verify .gitignore creation
    - Add .claude/settings.local.json to project .gitignore

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

    Co-Authored-By: Claude <noreply@anthropic.com>

Co-authored-by: Ben Madore <madorb@users.noreply.github.com>
2025-10-17 11:24:39 -07:00
Steve Yegge
1a82bbaee3 chore: Bump version to 0.9.9
Updated all component versions:
- bd CLI: 0.9.8 → 0.9.9
- Plugin: 0.9.8 → 0.9.9
- MCP server: 0.9.8 → 0.9.9
- Documentation: 0.9.8 → 0.9.9

Generated by scripts/bump-version.sh
2025-10-17 00:33:27 -07:00
Steve Yegge
37d60d624d Add critical warning banner about multiple workstreams
Amp-Thread-ID: https://ampcode.com/threads/T-36d8c02f-09ec-4921-b09d-ea5cd8ede317
Co-authored-by: Amp <amp@ampcode.com>
2025-10-16 19:13:04 -07:00