Commit Graph

1705 Commits

Author SHA1 Message Date
Steve Yegge
52833704f0 bd sync: 2025-11-07 19:07:55 2025-11-07 19:07:55 -08:00
Steve Yegge
0e8936bf61 Fix test failures: update to new AddDependencyParams field names
- Update tests to use issue_id/depends_on_id instead of from_id/to_id
- Fix test_client_lazy_initialization to mock create_bd_client instead of BdClient
- Add workspace setup for lazy initialization test
- Fixes 2 test failures (now 123 passing, down from 121)

Amp-Thread-ID: https://ampcode.com/threads/T-71b3ce65-87cb-451a-a30d-162d76d92f9c
Co-authored-by: Amp <amp@ampcode.com>
2025-11-07 19:07:49 -08:00
Steve Yegge
9eab271010 bd sync: 2025-11-07 19:05:05 2025-11-07 19:05:05 -08:00
Steve Yegge
62643ea8c6 Fix Windows MCP subprocess timeout for git detection (bd-r79z)
- Add shell=True for subprocess.run() on Windows platform
- Improves git command PATH resolution on Windows
- Add debug logging for git detection failures
- Fixes GH#245 timeout issue where git rev-parse times out in MCP server

Amp-Thread-ID: https://ampcode.com/threads/T-71b3ce65-87cb-451a-a30d-162d76d92f9c
Co-authored-by: Amp <amp@ampcode.com>
2025-11-07 19:05:02 -08:00
Steve Yegge
7fa0c93195 Fix daemon orphaning: track parent PID and exit when parent dies
- Add ParentPID field to DaemonLockInfo struct
- Daemon monitors parent process every 10 seconds
- Gracefully exits when parent process dies
- Prevents accumulation of orphaned daemons from dead sessions
- Fixes race conditions from multiple daemons on same database

Closes bd-zpnq
2025-11-07 18:57:43 -08:00
Steve Yegge
a6c9579645 bd sync: 2025-11-07 18:57:35 2025-11-07 18:57:35 -08:00
Steve Yegge
c81c1653fd Fix beads-mcp workspace context persistence and buffer overflow
Fixes bd-ww0g - Two critical bugs in beads-mcp v0.21:

1. "No workspace set" error after successful set_context:
   - Root cause: os.environ doesn't persist across MCP tool calls
   - Solution: Added module-level _workspace_context dict (server.py)
   - Modified set_context(), with_workspace(), where_am_i() to use persistent storage

2. "chunk longer than limit" MCP buffer overflow:
   - Root cause: Large issue lists exceed MCP stdio buffer limits
   - Solution: Reduced default list limit from 50 to 20
   - Strip dependencies/dependents from list() and ready() responses
   - Full details still available via show() command

Files changed:
- integrations/beads-mcp/src/beads_mcp/server.py
- integrations/beads-mcp/src/beads_mcp/models.py

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 16:54:17 -08:00
Steve Yegge
f1f144dbf3 bd sync: 2025-11-07 16:08:52 2025-11-07 16:08:52 -08:00
Steve Yegge
3e207dfca9 Add cleanup script for test pollution (bd-vxdr) 2025-11-07 16:08:47 -08:00
Steve Yegge
36919da128 bd sync: 2025-11-07 16:08:36 2025-11-07 16:08:36 -08:00
Steve Yegge
ced2a6c38f Merge remote changes after test pollution cleanup 2025-11-07 16:08:35 -08:00
Steve Yegge
705fcc0853 bd sync: 2025-11-07 16:08:11 2025-11-07 16:08:11 -08:00
Steve Yegge
a1ef05db98 Update bd JSONL 2025-11-07 16:07:25 -08:00
Steve Yegge
86d48a168d bd sync: 2025-11-07 16:03:56 2025-11-07 16:03:56 -08:00
Steve Yegge
d9db9755a8 Sync beads database after merge
Amp-Thread-ID: https://ampcode.com/threads/T-37164fd7-6452-40b0-b5dd-c13672dcb843
Co-authored-by: Amp <amp@ampcode.com>
2025-11-07 15:56:30 -08:00
Steve Yegge
cdecc02e4d bd sync: 2025-11-07 15:56:20 2025-11-07 15:56:20 -08:00
Steve Yegge
4cfded14f5 Merge branch 'main' of github.com:steveyegge/beads
Amp-Thread-ID: https://ampcode.com/threads/T-37164fd7-6452-40b0-b5dd-c13672dcb843
Co-authored-by: Amp <amp@ampcode.com>

# Conflicts:
#	.beads/beads.jsonl
2025-11-07 15:56:17 -08:00
Steve Yegge
df8ad121aa Update beads issues - close bd-tuqd (GH#254 fix) 2025-11-07 15:56:05 -08:00
Steve Yegge
0815ac2602 bd sync: 2025-11-07 15:55:36 2025-11-07 15:55:36 -08:00
Steve Yegge
046e852861 Fix GH#254: bd init now detects and chains with existing git hooks
- Detect existing git hooks (pre-commit framework, custom scripts)
- Prompt user with 3 options: chain (recommended), overwrite, skip
- Chain mode preserves existing hooks by calling them first
- Overwrite mode creates timestamped backups
- Add tests for hook detection and installation
- Update documentation with chaining feature

Fixes silent overwrites of pre-commit framework hooks that caused
test failures to slip through.

Amp-Thread-ID: https://ampcode.com/threads/T-37164fd7-6452-40b0-b5dd-c13672dcb843
Co-authored-by: Amp <amp@ampcode.com>
2025-11-07 15:55:19 -08:00
Steve Yegge
d3de5519b2 Fix Windows SQLite support in releases
- Enable CGO in GoReleaser config
- Add MinGW cross-compiler for Windows builds
- Split builds per platform to configure correct CC
- Install cross-compilation toolchains in release workflow

Fixes #253

Amp-Thread-ID: https://ampcode.com/threads/T-8600ed89-42af-4785-b5dc-01ad37f1451d
Co-authored-by: Amp <amp@ampcode.com>
2025-11-07 15:54:59 -08:00
Steve Yegge
3191c9c3da Remove vc.db exclusion from FindDatabasePath filter
Only filter out backup files, allow vc.db to be a valid database

Amp-Thread-ID: https://ampcode.com/threads/T-8600ed89-42af-4785-b5dc-01ad37f1451d
Co-authored-by: Amp <amp@ampcode.com>
2025-11-07 14:55:01 -08:00
Steve Yegge
f5726fc437 docs: add system requirements section for glibc compatibility
Amp-Thread-ID: https://ampcode.com/threads/T-3680ef32-8d31-4120-bbbd-d50d559e956e
Co-authored-by: Amp <amp@ampcode.com>
2025-11-07 14:53:44 -08:00
Steve Yegge
46dbdc0170 Add version number to beads-mcp startup log
Fixes #247 - Shows version on initial INFO line to help users verify
sync between MCP server and bd CLI tool
2025-11-07 14:24:07 -08:00
Steve Yegge
b3ee850c62 Merge branch 'main' of github.com:steveyegge/beads 2025-11-07 14:22:36 -08:00
Steve Yegge
4907c59f99 Gitignore Formula/bd.rb - auto-generated by GoReleaser, real source is homebrew-beads tap 2025-11-07 14:22:33 -08:00
vector-sigma
6408ef65f4 Fix #249: Add nil storage checks to prevent RPC daemon crashes (#250)
The daemon RPC server was crashing with a nil pointer dereference when the
global daemon received list, ready, stats, or other storage-dependent RPC
requests. The global daemon is created with nil storage, causing these
operations to panic when they attempted to access storage methods.

This fix adds defensive nil checks at the beginning of all RPC handlers
that require storage access. When storage is unavailable, they now return
a proper JSON error response instead of crashing the daemon.

The error message also informs users that the global daemon is deprecated
and they should use local daemons instead.

Handlers fixed:
- handleCreate, handleUpdate, handleClose
- handleList, handleShow, handleReady, handleStale
- handleResolveID, handleStats, handleEpicStatus
- handleCompact, handleCompactStats
- handleDepAdd (and via handleSimpleStoreOp for all label/dep/comment ops)

Co-authored-by: Test User <test@example.com>
2025-11-07 14:21:14 -08:00
Matteo Landi
64742cd574 Fix SQLite driver name mismatch causing "unknown driver" errors (#252)
* fix: Use correct SQLite driver name 'sqlite3' instead of 'sqlite'

The ncruces/go-sqlite3 driver registers as 'sqlite3', but doctor.go
and example code were using 'sqlite', causing 'unknown driver' errors.

This fix corrects all sql.Open() calls to use the proper driver name:
- cmd/bd/doctor.go: 6 instances fixed
- docs/EXTENDING.md: 2 documentation examples updated
- examples/bd-example-extension-go/: Fixed example code and README

Fixes #230

Amp-Thread-ID: https://ampcode.com/threads/T-1e8c5473-cb79-4457-be07-4517bfdb73f4
Co-authored-by: Amp <amp@ampcode.com>

* Revert CGO_ENABLED back to 0 for pure-Go SQLite driver

The ncruces/go-sqlite3 driver is pure-Go and doesn't require CGO.
The previous change to CGO_ENABLED=1 in commit f9771cd was an
attempted fix for #230, but the real issue was the driver name
mismatch ('sqlite' vs 'sqlite3'), which is now fixed.

Benefits of CGO_ENABLED=0:
- Simpler cross-compilation (no C toolchain required)
- Smaller binaries
- Faster builds
- Matches the intended design of the pure-Go driver

---------

Co-authored-by: Amp <amp@ampcode.com>
2025-11-07 14:19:14 -08:00
Steve Yegge
2db2203630 Sync bd issues 2025-11-07 09:54:21 -08:00
Steve Yegge
ba87533f34 bd sync: 2025-11-07 09:50:03 2025-11-07 09:50:03 -08:00
Markus Flür
e7f532db93 Implementing an RPC monitoring solution with a web-ui as implementation example. (#244)
* bd sync: 2025-10-30 12:12:27

* Working on frontend

* bd sync: 2025-11-06 16:55:55

* feat: finish bd monitor human viewer

* Merge conflicts resolved and added tests

* bd sync: 2025-11-06 17:23:41

* bd sync: 2025-11-06 17:34:52

* feat: Add reload button and multiselect status filter to monitor

- Changed status filter from single select to multiselect with 'Open' selected by default
- Added reload button with visual feedback (hover/active states)
- Updated filterIssues() to handle multiple selected statuses
- Added reloadData() function that reloads both stats and issues
- Improved responsive design for mobile devices
- Filter controls now use flexbox layout with better spacing

* fix: Update monitor statistics to show Total, In Progress, Open, Closed

- Replaced 'Ready to Work' stat with 'In Progress' stat
- Reordered stats to show logical progression: Total -> In Progress -> Open -> Closed
- Updated loadStats() to fetch in-progress count from stats API
- Removed unnecessary separate API call for ready count

* fix: Correct API field names in monitor stats JavaScript

The JavaScript was using incorrect field names (stats.total, stats.by_status)
that don't match the actual types.Statistics struct which uses flat fields
with underscores (total_issues, in_progress_issues, etc).

Fixed by updating loadStats() to use correct field names:
- stats.total -> stats.total_issues
- stats.by_status?.['in-progress'] -> stats.in_progress_issues
- stats.by_status?.open -> stats.open_issues
- stats.by_status?.closed -> stats.closed_issues

Fixes beads-9

* bd sync: 2025-11-06 17:51:24

* bd sync: 2025-11-06 17:56:09

* fix: Make monitor require daemon to prevent SQLite locking

Implemented Option 1 from beads-eel: monitor now requires daemon and never
opens direct SQLite connection.

Changes:
- Added 'monitor' to noDbCommands list in main.go to skip normal DB initialization
- Added validateDaemonForMonitor() PreRun function that:
  - Finds database path using beads.FindDatabasePath()
  - Validates daemon is running and healthy
  - Fails gracefully with clear error message if no daemon
  - Only uses RPC connection, never opens SQLite directly

Benefits:
- Eliminates SQLite locking conflicts between monitor and daemon
- Users can now close/update issues via CLI while monitor runs
- Clear error messages guide users to start daemon first

Fixes beads-eel

* bd sync: 2025-11-06 18:03:50

* docs: Add bd daemons restart subcommand documentation

Added documentation for the 'bd daemons restart' subcommand across all documentation files:

- commands/daemons.md: Added full restart subcommand section with synopsis, description, arguments, flags, and examples
- README.md: Added restart examples to daemon management section
- AGENTS.md: Added restart examples with --json flag for agents

The restart command gracefully stops and starts a specific daemon by workspace path or PID,
useful after upgrading bd or when a daemon needs refreshing.

Fixes beads-11

* bd sync: 2025-11-06 18:13:16

* Separated the web ui from the general monitoring functionality

---------

Co-authored-by: Steve Yegge <stevey@sourcegraph.com>
2025-11-07 09:49:12 -08:00
Steve Yegge
19da81caea bd sync: 2025-11-07 00:28:01 2025-11-07 00:28:01 -08:00
Andrew Fong
770e09004d Add docs/ directory to links (#242)
* Add docs/ prefix to links

Some old links that broke when moving docs probably

* Fix a few more spots

Add `docs/` directory to some more broken links
2025-11-07 00:24:00 -08:00
Steve Yegge
0106371e12 Prevent nested .beads directories (bd-eqjc)
Add validation in bd init to detect if current directory is inside
a .beads directory and exit with clear error message. This prevents
the common issue of accidentally creating .beads/.beads/ nested
directories.
2025-11-06 22:23:54 -08:00
Steve Yegge
769cd7b1d3 bd sync: 2025-11-06 22:23:46 2025-11-06 22:23:46 -08:00
Steve Yegge
ef8585bd2e feat: Add automatic Homebrew formula update to release workflow 2025-11-06 20:35:25 -08:00
Steve Yegge
626cd44a28 chore: Bump version to 0.22.1
Updated all component versions:
- bd CLI: 0.22.0 → 0.22.1
- Plugin: 0.22.0 → 0.22.1
- MCP server: 0.22.0 → 0.22.1
- npm package: 0.22.0 → 0.22.1
- Documentation: 0.22.0 → 0.22.1

Generated by scripts/bump-version.sh
2025-11-06 20:25:36 -08:00
Steve Yegge
e47d258f54 fix: Handle missing PLUGIN.md in git add during version bump 2025-11-06 20:25:31 -08:00
Steve Yegge
5fc55489af fix: Make PLUGIN.md update optional in bump-version.sh 2025-11-06 20:24:34 -08:00
Steve Yegge
559d1ecf65 docs: Add CHANGELOG entry for v0.22.1 2025-11-06 20:24:09 -08:00
Steve Yegge
6b25ad1122 bd sync: 2025-11-06 20:15:41 2025-11-06 20:15:41 -08:00
Steve Yegge
ca5e32e5f2 Remove commented-out code
Cleaned up old bd-160 export hash tracking code that was disabled.
Removed unnecessary test comments.

Amp-Thread-ID: https://ampcode.com/threads/T-de38a626-a425-414f-92d8-102bc1519c8b
Co-authored-by: Amp <amp@ampcode.com>
2025-11-06 20:15:34 -08:00
Steve Yegge
95cbcf4fbc Centralize BD_DEBUG logging into internal/debug package
- Created internal/debug package with Enabled(), Logf(), Printf()
- Added comprehensive unit tests for debug package
- Replaced 50+ scattered os.Getenv("BD_DEBUG") checks across 9 files
- Centralized debug logic for easier maintenance and testing
- All tests passing, behavior unchanged

Closes bd-fb95094c.5
2025-11-06 20:14:34 -08:00
Steve Yegge
04621fe731 bd sync: close bd-fb95094c.7 2025-11-06 20:07:12 -08:00
Steve Yegge
b655b29ad9 Extract SQLite migrations into separate files (bd-fb95094c.7)
- Created migrations/ subdirectory with 14 individual migration files
- Reduced migrations.go from 680 to 98 lines (orchestration only)
- Updated test imports to use migrations package
- Updated MULTI_REPO_HYDRATION.md documentation
- All tests passing
2025-11-06 20:06:45 -08:00
Steve Yegge
0095464e83 bd sync: 2025-11-06 20:00:09 2025-11-06 20:00:09 -08:00
Steve Yegge
9520e7a2e2 Extract normalizeLabels to internal/util/strings.go
- Created internal/util/strings.go with NormalizeLabels function
- Added comprehensive tests in internal/util/strings_test.go
- Updated internal/rpc/server_issues_epics.go to use util.NormalizeLabels
- Updated cmd/bd/list.go and cmd/bd/ready.go to use util.NormalizeLabels
- Updated cmd/bd/list_test.go to use util.NormalizeLabels
- Removed duplicate implementations
- All tests pass

Fixes bd-fb95094c.6

Amp-Thread-ID: https://ampcode.com/threads/T-edb3c286-cd60-4231-94cd-edaf75d84a3d
Co-authored-by: Amp <amp@ampcode.com>
2025-11-06 20:00:08 -08:00
Steve Yegge
5044ec3fdf Merge remote changes
Amp-Thread-ID: https://ampcode.com/threads/T-edb3c286-cd60-4231-94cd-edaf75d84a3d
Co-authored-by: Amp <amp@ampcode.com>
2025-11-06 20:00:01 -08:00
Steve Yegge
9d421e77e6 bd sync: 2025-11-06 19:59:52 2025-11-06 19:59:52 -08:00
Steve Yegge
78c9d744cb Add edge case tests for getMultiRepoJSONLPaths()
- Test empty path handling (returns nil for single-repo mode)
- Test duplicate paths (documents non-deduping behavior)
- Test paths with spaces (handles correctly)
- Test relative paths (not normalized, used as-is)
- Test tilde expansion (not expanded, used literally)

Closes bd-kdoh

Amp-Thread-ID: https://ampcode.com/threads/T-ac07d8fd-51a3-4511-a477-d7041b950ea8
Co-authored-by: Amp <amp@ampcode.com>
2025-11-06 19:54:59 -08:00