Commit Graph

86 Commits

Author SHA1 Message Date
Steve Yegge
6ecfd04ec8 Implement BEADS_DIR environment variable (bd-e16b)
Add BEADS_DIR as a replacement for BEADS_DB to point to the .beads
directory instead of the database file directly.

Rationale:
- With --no-db mode, there's no .db file to point to
- The .beads directory is the logical unit (contains config.yaml, db
  files, jsonl files)
- More intuitive: point to the beads directory not the database file

Implementation:
- Add BEADS_DIR environment variable support to FindDatabasePath()
- Priority order: BEADS_DIR > BEADS_DB > auto-discovery
- Maintain backward compatibility with BEADS_DB (now deprecated)
- Update --no-db mode to respect BEADS_DIR
- Update MCP integration (config.py, bd_client.py)
- Update documentation to show BEADS_DIR as preferred method

Testing:
- Backward compatibility: BEADS_DB still works
- BEADS_DIR works with regular database mode
- BEADS_DIR works with --no-db mode
- Priority: BEADS_DIR takes precedence over BEADS_DB

Follow-up issues for refactoring:
- bd-efe8: Refactor path canonicalization into helper function
- bd-c362: Extract database search logic into helper function

Closes bd-e16b

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 18:36:30 -08:00
Steve Yegge
24936937f7 Add MCP tools for migration inspection (bd-627d Phase 3)
- Add inspect_migration() tool - calls bd migrate --inspect --json
- Add get_schema_info() tool - calls bd info --schema --json
- Implements abstract methods in BdClientBase
- CLI client calls commands directly
- Daemon client raises NotImplementedError (rare admin commands)

Phase 3 complete. Agents can now inspect migrations via MCP before running them.

Amp-Thread-ID: https://ampcode.com/threads/T-de7e1141-87ac-4b4a-9cea-1b7bc4d51da9
Co-authored-by: Amp <amp@ampcode.com>
2025-11-02 14:14:13 -08:00
Steve Yegge
f84c2597fa Improve set_context timeout handling - fail instead of guessing path
- Increase timeout to 5s for slow git operations
- Return error instead of falling back to unverified path
- Prevents accidental .beads creation in wrong directory
2025-11-02 11:03:50 -08:00
Steve Yegge
8304ca7379 Fix GH #153: set_context hangs with stdio transport
Move blocking subprocess.run() call off event loop using asyncio.to_thread()
with timeout to prevent deadlock when using stdio transport.

- Wrap _resolve_workspace_root() in asyncio.to_thread() with 2s timeout
- Add fallback to os.path.abspath() on timeout
- Ensure logging uses stderr to avoid stdio protocol pollution

Amp-Thread-ID: https://ampcode.com/threads/T-fc335bda-5fca-4daa-bdc1-5d53d0eb818f
Co-authored-by: Amp <amp@ampcode.com>
2025-11-02 11:02:42 -08:00
Steve Yegge
b61bf32339 chore: Bump version to 0.21.3
Updated all component versions:
- bd CLI: 0.21.2 → 0.21.3
- Plugin: 0.21.2 → 0.21.3
- MCP server: 0.21.2 → 0.21.3
- Documentation: 0.21.2 → 0.21.3
2025-11-01 23:49:55 -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
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
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
ed5efe7f4b Update beads-mcp version to 0.16.0
Amp-Thread-ID: https://ampcode.com/threads/T-d4392285-dfd0-44d9-86e2-788fbb7aa7d1
Co-authored-by: Amp <amp@ampcode.com>
2025-10-31 02:04:13 -07:00
Steve Yegge
7dcde1330e Remove obsolete --db flag from MCP server
The --db flag was removed in bd v0.20.1 in favor of automatic database
discovery via cwd. The MCP server now relies on passing the workspace
directory via cwd parameter instead of the --db flag.

This fixes compatibility with bd v0.20.1+.
2025-10-31 02:02:38 -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
7c36a68476 chore: Bump version to 0.20.0
Amp-Thread-ID: https://ampcode.com/threads/T-5d7f722e-ec33-499a-bd3d-e684c554d7fe
Co-authored-by: Amp <amp@ampcode.com>
2025-10-30 20:40:13 -07:00
Steve Yegge
7aba8ad79c chore: Bump version to 0.19.1 2025-10-30 17:16:59 -07:00
Steve Yegge
0f1b597961 chore: Bump version to 0.19.0
Release highlights:
- Fix bd-160: JSONL integrity validation prevents export deduplication data loss
- Add comprehensive integration tests for export/import workflows
- Clear export_hashes on imports to prevent staleness
- Created bd-179 epic for remaining test coverage improvements

This release fixes a critical P0 bug that could cause silent data loss
when JSONL and export_hashes diverged after git operations.
2025-10-29 22:05:18 -07:00
Steve Yegge
b2d874cbbf chore: Bump version to 0.18.0
Amp-Thread-ID: https://ampcode.com/threads/T-34d05149-eda4-40e0-b758-28a736a7eba6
Co-authored-by: Amp <amp@ampcode.com>
2025-10-29 19:34:01 -07:00
Steve Yegge
d2920e3701 Remove cache_size from MCP docs and tests 2025-10-28 10:50:00 -07:00
dependabot[bot]
b882672673 Bump fastmcp from 2.12.4 to 2.13.0.1 in /integrations/beads-mcp
Bumps [fastmcp](https://github.com/jlowin/fastmcp) from 2.12.4 to 2.13.0.1.
- [Release notes](https://github.com/jlowin/fastmcp/releases)
- [Changelog](https://github.com/jlowin/fastmcp/blob/main/docs/changelog.mdx)
- [Commits](https://github.com/jlowin/fastmcp/compare/v2.12.4...v2.13.0.1)

---
updated-dependencies:
- dependency-name: fastmcp
  dependency-version: 2.13.0.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 22:41:01 -07:00
Steve Yegge
d7b5cf75ba Update uv.lock for 0.17.7 2025-10-26 23:45:55 -07:00
Steve Yegge
687376f969 chore: Bump version to 0.17.7
Updated all component versions:
- bd CLI: 0.17.6 → 0.17.7
- Plugin: 0.17.6 → 0.17.7
- MCP server: 0.17.6 → 0.17.7
- Documentation: 0.17.6 → 0.17.7

Generated by scripts/bump-version.sh
2025-10-26 23:30:37 -07:00
Steve Yegge
740a6aea99 Update uv.lock for 0.17.6 2025-10-26 23:30:24 -07:00
Steve Yegge
1b4f56d675 chore: Bump version to 0.17.6
Updated all component versions:
- bd CLI: 0.17.5 → 0.17.6
- Plugin: 0.17.5 → 0.17.6
- MCP server: 0.17.5 → 0.17.6
- Documentation: 0.17.5 → 0.17.6

Generated by scripts/bump-version.sh
2025-10-26 23:08:15 -07:00
Steve Yegge
2dd96bff43 chore: Bump version to 0.17.5
Updated all component versions:
- bd CLI: 0.17.4 → 0.17.5
- Plugin: 0.17.4 → 0.17.5
- MCP server: 0.17.4 → 0.17.5
- Documentation: 0.17.4 → 0.17.5

Generated by scripts/bump-version.sh
2025-10-26 17:42:05 -07:00
Steve Yegge
80b0af9457 chore: Bump version to 0.17.4
Updated all component versions:
- bd CLI: 0.17.3 → 0.17.4
- Plugin: 0.17.3 → 0.17.4
- MCP server: 0.17.3 → 0.17.4
- Documentation: 0.17.3 → 0.17.4

Generated by scripts/bump-version.sh
2025-10-26 14:20:03 -07:00
Steve Yegge
d297848f76 chore: Bump version to 0.17.3
Updated all component versions:
- bd CLI: 0.17.2 → 0.17.3
- Plugin: 0.17.2 → 0.17.3
- MCP server: 0.17.2 → 0.17.3
- Documentation: 0.17.2 → 0.17.3

Generated by scripts/bump-version.sh
2025-10-26 13:59:01 -07:00
Steve Yegge
5b963e3379 chore: Bump version to 0.17.2 2025-10-25 18:57:47 -07:00
Steve Yegge
744563e87f Add health checks and reconnection logic for stale daemon sockets (bd-137)
- Add ping() and health() methods to BdDaemonClient for connection verification
- Implement _health_check_client() to verify cached client connections
- Add _reconnect_client() with exponential backoff (0.1s, 0.2s, 0.4s, max 3 retries)
- Update _get_client() to health-check before returning cached clients
- Automatically detect and remove stale connections from pool
- Add comprehensive test suite with 14 tests covering all scenarios
- Handle daemon restarts, upgrades, and long-idle connections gracefully

Amp-Thread-ID: https://ampcode.com/threads/T-2366ef1b-389c-4293-8145-7613037c9dfa
Co-authored-by: Amp <amp@ampcode.com>
2025-10-25 17:39:21 -07:00
Steve Yegge
d301ac68ed chore: Bump version to 0.17.1
Updated all component versions:
- bd CLI: 0.17.0 → 0.17.1
- Plugin: 0.17.0 → 0.17.1
- MCP server: 0.17.0 → 0.17.1
- Documentation: 0.17.0 → 0.17.1

Generated by scripts/bump-version.sh
2025-10-25 16:45:16 -07:00
Steve Yegge
de03466da9 Fix bd-143: Prevent daemon auto-sync from wiping out issues.jsonl with empty database
- Added safety check to exportToJSONLWithStore (daemon path)
- Refuses to export 0 issues over non-empty JSONL file
- Added --force flag to override safety check when intentional
- Added test coverage for empty database export protection
- Prevents data loss when daemon has wrong/empty database

Amp-Thread-ID: https://ampcode.com/threads/T-de18e0ad-bd17-46ec-994b-0581e257dcde
Co-authored-by: Amp <amp@ampcode.com>
2025-10-25 16:36:18 -07:00
Steve Yegge
667d41e9d4 chore: Bump version to 0.17.0
Updated all component versions:
- bd CLI: 0.16.0 → 0.17.0
- Plugin: 0.16.0 → 0.17.0
- MCP server: 0.16.0 → 0.17.0
- Documentation: 0.16.0 → 0.17.0

Generated by scripts/bump-version.sh
2025-10-24 22:36:06 -07:00
Steve Yegge
f5feee0d20 Remove global daemon from docs, deprecate bd repos command
- Stub out 'bd repos' command with deprecation message
- Remove 140+ lines of global daemon/multi-repo docs from ADVANCED.md
- Add architecture section explaining daemon/MCP/beads roles (LSP model)
- Update AGENTS.md, MCP README, FAQ.md to emphasize per-project daemons
- Update commands/daemon.md and commands/repos.md

Closes #140

Global daemon was removed in v0.16.0 due to cross-project pollution
risks. bd now uses per-project local daemons (one per workspace) for
complete database isolation, following LSP architecture patterns.

Amp-Thread-ID: https://ampcode.com/threads/T-c45147dc-8939-43bf-8fbd-303ed4a8d845
Co-authored-by: Amp <amp@ampcode.com>
2025-10-24 13:02:16 -07:00
Steve Yegge
474b6bf000 chore: Bump version to 0.16.0
Updated all component versions:
- bd CLI: 0.15.0 → 0.16.0
- Plugin: 0.15.0 → 0.16.0
- MCP server: 0.15.0 → 0.16.0
- Documentation: 0.15.0 → 0.16.0

Generated by scripts/bump-version.sh
2025-10-23 20:02:05 -07:00
Steve Yegge
9665b335dc chore: Bump version to 0.15.0
Updated all component versions:
- bd CLI: 0.14.0 → 0.15.0
- Plugin: 0.14.0 → 0.15.0
- MCP server: 0.14.0 → 0.15.0
- Documentation: 0.14.0 → 0.15.0

Generated by scripts/bump-version.sh
2025-10-23 14:26:40 -07:00
Steve Yegge
feac3f86e7 MCP: Smart routing for lifecycle status changes in update tool
- update(status="closed") now routes to close() tool
- update(status="open") now routes to reopen() tool
- Respects Claude Code approval workflows for lifecycle events
- Prevents bypass of approval settings
- bd CLI remains unopinionated; routing only in MCP layer
- Users can safely auto-approve benign updates without exposing closure bypass

Fixes #123

Amp-Thread-ID: https://ampcode.com/threads/T-8b85a68e-7e06-460e-9840-9c6b6a6b7e85
Co-authored-by: Amp <amp@ampcode.com>
2025-10-23 14:10:33 -07:00
Steve Yegge
4f1d1a2cca Fix MCP dep tool parameter names to match CLI (issue_id/depends_on_id)
- Changed from confusing from_id/to_id to clear issue_id/depends_on_id
- Matches CLI convention: bd dep add [issue-id] [depends-on-id]
- Updated all tests and implementations
- Fixes GH #113 where Claude Code was creating dependencies backwards

Closes bd-58

Amp-Thread-ID: https://ampcode.com/threads/T-f01aca11-a10f-4908-9ce6-7e1734f2068f
Co-authored-by: Amp <amp@ampcode.com>
2025-10-23 13:07:44 -07:00
Steve Yegge
10a313e3a6 Add integration tests for worktree workflow with separate databases
- Created test_worktree_separate_dbs.py with 6 comprehensive tests
- Verifies recommended workflow: one .beads database per worktree
- Tests confirm MCP works with BEADS_USE_DAEMON=0 in worktrees
- Validates database isolation, git syncing, and --no-daemon flag
- All tests passing

Addresses GH #119

Amp-Thread-ID: https://ampcode.com/threads/T-57d5c589-0522-4059-8183-2f0f7f1dccba
Co-authored-by: Amp <amp@ampcode.com>
2025-10-23 13:06:05 -07:00
Steve Yegge
4f560379f2 Add description parameter to bd update command and MCP server
Fixes #114 and #122 by adding --description/-d flag to bd update CLI
and description parameter to MCP update_issue tool.

Changes:
- CLI: Added --description flag to updateCmd
- RPC: Added Description field to UpdateArgs
- Daemon: Updated updatesFromArgs to handle description
- MCP: Added description to update_issue, UpdateIssueParams, and clients
- Storage: description already supported in allowedUpdateFields

Tested in both daemon and direct modes.
2025-10-23 11:00:19 -07:00
Steve Yegge
09a9865087 chore: Bump version to 0.14.0
Updated all component versions:
- bd CLI: 0.12.0 → 0.14.0
- Plugin: 0.12.0 → 0.14.0
- MCP server: 0.12.0 → 0.14.0
- Documentation: 0.12.0 → 0.14.0

Generated by scripts/bump-version.sh
2025-10-22 23:15:18 -07:00
Steve Yegge
d0bd0a7e0d chore: Bump version to 0.12.0
Updated all component versions:
- bd CLI: 0.11.0 → 0.12.0
- Plugin: 0.11.0 → 0.12.0
- MCP server: 0.11.0 → 0.12.0
- Documentation: 0.11.0 → 0.12.0

Generated by scripts/bump-version.sh
2025-10-22 18:24:27 -07:00
Steve Yegge
935470a3d8 Fix MCP close method signature bug (GH #107, bd-67)
- Fix BdDaemonClient.close() to accept issue_id and reason parameters
- Remove uv.lock from repo

Amp-Thread-ID: https://ampcode.com/threads/T-0017f48d-605c-410f-9a77-db62153c9357
Co-authored-by: Amp <amp@ampcode.com>
2025-10-22 17:53:28 -07:00
Steve Yegge
42762188ed Fix MCP close tool method signature error (GH #107)
Renamed BdDaemonClient.close() cleanup method to cleanup() to eliminate
method name collision with async close(params) method for closing issues.

Root cause: Python method resolution meant the non-async close(self)
cleanup method was shadowing the async close(self, params) method that
closes issues, causing 'takes 1 positional argument but 2 were given'.

Changes:
- bd_daemon_client.py: Renamed close() -> cleanup()
- server.py: Updated cleanup code to call cleanup() instead of close()
- test_lifecycle.py: Updated tests to use cleanup()

All close-related tests pass. Fixes GitHub issue #107.
Tracked in bd-67 (closed).
2025-10-22 17:43:11 -07:00
Steve Yegge
2a032ae3ba chore: Bump version to 0.11.0
Updated all component versions:
- bd CLI: 0.10.1 → 0.11.0
- Plugin: 0.10.1 → 0.11.0
- MCP server: 0.10.1 → 0.11.0
- Documentation: 0.10.1 → 0.11.0

Generated by scripts/bump-version.sh
2025-10-22 01:09:25 -07:00
mountaintopsolutions
0f044117b4 Normalize --acceptance flag for bd update command (#102)
- Update bd update to use --acceptance instead of --acceptance-criteria
- Update MCP client to use --acceptance flag
- Simplify SKILL.md documentation now that both commands use same flag

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-22 00:15:54 -07:00
Steve Yegge
ec946ee48b Fix #97: Add daemon mode check to rename-prefix command
- Prevents nil pointer dereference when daemon is active
- Ensures direct mode or fails gracefully
- Lower Python requirement to 3.10+ for beads-mcp (#99)

Amp-Thread-ID: https://ampcode.com/threads/T-740c6f9c-b8f0-4155-8bfa-7075eea2df22
Co-authored-by: Amp <amp@ampcode.com>
2025-10-21 14:56:18 -07:00
Steve Yegge
f4dd9e09a1 Fix MCP update tool bypassing close approval workflow
- Detect when update is called with status='closed'
- Redirect to close_issue to preserve approval workflow
- Ensures closing tasks always requires same approval regardless of tool used

Fixes #90

Amp-Thread-ID: https://ampcode.com/threads/T-9eab3a82-18f3-4ae3-a2d5-d114811383c1
Co-authored-by: Amp <amp@ampcode.com>
2025-10-20 23:47:56 -07:00
Steve Yegge
19b3200cd4 chore: Bump version to 0.10.1
Updated all component versions:
- bd CLI: 0.10.0 → 0.10.1
- Plugin: 0.10.0 → 0.10.1
- MCP server: 0.9.11 → 0.10.1
- Documentation: 0.10.0 → 0.10.1

Includes fix for bd-179 (derive prefix from database filename)
2025-10-20 22:18:41 -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
5045496bbe Bump version to 0.10.0 2025-10-20 15:27:30 -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
095ebc70e6 Fix MCP server None/null crashes in list/ready/stats (bd-172, fixes #79)
Add null safety checks in bd_daemon_client.py:
- list_issues(): Return empty array if issues_data is None
- ready(): Return empty array if issues_data is None
- stats(): Use empty dict if stats_data is None

This prevents TypeError crashes when daemon returns None/empty responses.

Amp-Thread-ID: https://ampcode.com/threads/T-072304c3-3a03-4091-92a9-9e16b4538227
Co-authored-by: Amp <amp@ampcode.com>
2025-10-19 23:23:33 -07:00