The .claude/skills/ directories are created by Claude Code when agents
add skills (ghi-list, pr-list, handoff). These should not be tracked.
Fixes: gt-q0jy15.2
- Add witness, deacon, refinery role templates
- Ignore bd_test binary (bd-test was already ignored)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add --notes flag to bd create command, enabling agents to set notes
during issue creation instead of requiring a separate update command.
Motivation: AI agents repeatedly tried to use --notes with bd create.
Context is fresh at creation time - forcing a two-step process means
context loss or workflow interruption.
Changes:
- cmd/bd/flags.go: Added --notes flag to common issue flags
- cmd/bd/create.go: Read and pass notes in both RPC and direct modes
- cmd/bd/update.go: Removed duplicate --notes flag definition
- internal/rpc/protocol.go: Added Notes field to CreateArgs
- internal/rpc/server_issues_epics.go: Process Notes in handleCreate
- cmd/bd/create_notes_test.go: Comprehensive test coverage
- website/docs/cli-reference/issues.md: Documentation
Also adds gitignore entries for Augment AI and .beads/redirect.
Co-authored-by: Leon Letto <lettol@vmware.com>
Wisps now use Wisp=true flag in the main database. The separate
.beads-wisp/ directory is no longer needed.
Removed:
- WispDirName constant
- FindWispDir()
- FindWispDatabasePath()
- NewWispStorage()
- EnsureWispGitignore()
- IsWispDatabase()
- All related tests
- .beads-wisp/ from .gitignore
Adds comprehensive Git worktree support for beads issue tracking:
Core changes:
- New internal/git/gitdir.go package for worktree detection
- GetGitDir() returns proper .git location (main repo, not worktree)
- Updated all hooks to use git.GetGitDir() instead of local helper
- BeadsDir() now prioritizes main repository's .beads directory
Features:
- Hooks auto-install in main repo when run from worktree
- Shared .beads directory across all worktrees
- Config option no-install-hooks to disable auto-install
- New bd worktree subcommand for diagnostics
Documentation:
- New docs/WORKTREES.md with setup instructions
- Updated CHANGELOG.md and AGENT_INSTRUCTIONS.md
Testing:
- Updated tests to use exported git.GetGitDir()
- Added worktree detection tests
Co-authored-by: Claude <noreply@anthropic.com>
Closes: #478
The daemon-error file is a transient runtime file created when the daemon
fails to start. It should not be tracked in git.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes bd-44e: Remove deletions.jsonl from .gitignore.
The deletions manifest MUST be tracked in git for cross-clone deletion
propagation to work (bd-imj). Previously it was incorrectly gitignored
with a "local-only" comment that contradicted the design.
Changes:
- Remove .beads/deletions.jsonl from .gitignore
- Add comment explaining why it is tracked
- Track existing deletions.jsonl file
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: add performance testing framework foundation
Implements foundation for comprehensive performance testing and user
diagnostics for beads databases at 10K-20K scale.
Components added:
- Fixture generator (internal/testutil/fixtures/) for realistic test data
* LargeSQLite/XLargeSQLite: 10K/20K issues with epic hierarchies
* LargeFromJSONL/XLargeFromJSONL: test JSONL import path
* Realistic cross-linked dependencies, labels, assignees
* Reproducible with seeded RNG
- User diagnostics (bd doctor --perf) for field performance data
* Collects platform info (OS, arch, Go/SQLite versions)
* Measures key operation timings (ready, list, show, search)
* Generates CPU profiles for bug reports
* Clean separation in cmd/bd/doctor/perf.go
Test data characteristics:
- 10% epics, 30% features, 60% tasks
- 4-level hierarchies (Epic → Feature → Task → Subtask)
- 20% cross-epic blocking dependencies
- Realistic status/priority/label distributions
Supports bd-l954 (Performance Testing Framework epic)
Closes bd-6ed8, bd-q59i
* perf: optimize GetReadyWork with compound index (20x speedup)
Add compound index on dependencies(depends_on_id, type, issue_id) to
eliminate performance bottleneck in GetReadyWork recursive CTE query.
Performance improvements (10K issue database):
- GetReadyWork: 752ms → 36.6ms (20.5x faster)
- Target: <50ms ✓ ACHIEVED
- 20K database: ~1500ms → 79.4ms (19x faster)
Benchmark infrastructure enhancements:
- Add dataset caching in /tmp/beads-bench-cache/ to avoid regenerating
10K-20K issues on every benchmark run (first run: ~2min, subsequent: <5s)
- Add progress logging during fixture generation (shows 10%, 20%... completion)
- Add database size logging (17.5 MB for 10K, 35.1 MB for 20K)
- Document rationale for only benchmarking large datasets (>10K issues)
- Add CPU/trace profiling with --profile flag for performance debugging
Schema changes:
- internal/storage/sqlite/schema.go: Add idx_dependencies_depends_on_type_issue
New files:
- internal/storage/sqlite/bench_helpers_test.go: Reusable benchmark setup with caching
- internal/storage/sqlite/sqlite_bench_test.go: Comprehensive benchmarks for critical operations
- Makefile: Convenient benchmark execution (make bench-quick, make bench)
Related:
- Resolves bd-5qim (optimize GetReadyWork performance)
- Builds on bd-6ed8 (fixture generator), bd-q59i (bd doctor --perf)
* perf: add WASM compilation cache to eliminate cold-start overhead
Configure wazero compilation cache for ncruces/go-sqlite3 to avoid
~220ms JIT compilation on every process start.
Cache configuration:
- Location: ~/.cache/beads/wasm/ (platform-specific via os.UserCacheDir)
- Automatic version management: wazero keys entries by its version
- Fallback: in-memory cache if directory creation fails
- No cleanup needed: old versions are harmless (~5-10MB each)
Performance impact:
- First run: ~220ms (populate cache)
- Subsequent runs: ~20ms (load from cache)
- Savings: ~200ms per cold start
Cache invalidation:
- Automatic when wazero version changes (upgrades use new cache dir)
- Manual cleanup: rm -rf ~/.cache/beads/wasm/ (safe to delete anytime)
This complements daemon mode:
- Daemon mode: eliminates startup cost by keeping process alive
- WASM cache: reduces startup cost for one-off commands or daemon restarts
Changes:
- internal/storage/sqlite/sqlite.go: Add init() with cache setup
* refactor: improve maintainability of performance testing code
Extract common patterns and eliminate duplication across benchmarks, fixture generation, and performance diagnostics. Replace magic numbers with explicit configuration to improve readability and make it easier to tune test parameters.
* docs: clarify profiling behavior and add missing documentation
Add explanatory comments for profiling setup to clarify why --profile
forces direct mode (captures actual database operations instead of RPC
overhead) and document the stopCPUProfile function's role in flushing
profile data to disk. Also fix gosec G104 linter warning by explicitly
ignoring Close() error during cleanup.
* fix: prevent bench-quick from running indefinitely
Added //go:build bench tags and skipped timeout-prone benchmarks to
prevent make bench-quick from running for hours.
Changes:
- Add //go:build bench tag to cycle_bench_test.go and compact_bench_test.go
- Skip Dense graph benchmarks (documented to timeout >120s)
- Fix compact benchmark prefix: bd- → bd (validation expects prefix without trailing dash)
Before: make bench-quick ran for 3.5+ hours (12,699s) before manual interrupt
After: make bench-quick completes in ~25 seconds
The Dense graph benchmarks are known to timeout and represent rare edge
cases that don't need optimization for typical workflows.
The .envrc file is auto-generated by Agent Mail and contains
machine-specific environment variables (workspace paths, agent names).
It should not be committed to the repository.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Added __pycache__/ directories
- Added *.py[cod] and *.class files
- Removed tests/integration/__pycache__/ specific entry (now covered by general rule)
- Add 3-way merge deletion tracking using snapshot files
- Create .beads/beads.base.jsonl and .beads/beads.left.jsonl snapshots
- Integrate into both sync.go and daemon_sync.go
- Add comprehensive test suite in deletion_tracking_test.go
- Update .gitignore to exclude snapshot files
This fixes the resurrection bug where deleted issues come back after
multi-workspace git sync. Uses the beads-merge 3-way merge logic to
detect and apply deletions correctly.
- Export latest issue state to beads.jsonl
- Add gitignore entries for malformed SQLite DB files created by old buggy code
- Ignore bd-original backup
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
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>
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>
* Add .worktrees/ to .gitignore
Prevents git worktree contents from being tracked in the repository.
* Fix substring bug in dependency tree cycle detection
The cycle detection in GetDependencyTree() was using a simple substring
match which incorrectly flagged valid nodes as cycles. For example,
"bd-1" would be blocked because "bd-10" contains "bd-1" as a substring.
This bug affects any beads project where issue IDs contain each other as
substrings (BD-1/BD-10, ISSUE-1/ISSUE-10, etc).
Changed from:
AND t.path NOT LIKE '%' || i.id || '%'
To delimiter-aware checks that respect the → separator:
AND t.path != i.id
AND t.path NOT LIKE i.id || '→%'
AND t.path NOT LIKE '%→' || i.id || '→%'
AND t.path NOT LIKE '%→' || i.id
This ensures we only match complete issue IDs, not substrings.
Added TestGetDependencyTree_SubstringBug to demonstrate and prevent
regression of this issue. The test creates a chain from bd-10 to bd-1
and verifies all nodes appear in the dependency tree.
Discovered while testing dependency tree visualization with bd-1/bd-10.
- Change validateBatchIssues() to only set timestamps if IsZero()
- Preserves historical timestamps from external systems (Jira, GitHub)
- Fixes dirty git repo after importing unchanged JSONL
- New issues still get current timestamps as before
- Add daemon.lock to .gitignore
Closes bd-55
Fixes#121
Amp-Thread-ID: https://ampcode.com/threads/T-e53c4a96-38dd-440a-9b8d-824992d33a40
Co-authored-by: Amp <amp@ampcode.com>
* Fix autostart test to work in nix sandbox
* Break out a default.nix to make consuming this package easier
The flake is great for local development, but creates overhead and
duplication when pulling it in on another machine. With the default.nix,
the flake continues to work as before, but consumers can callPackage directly
with their own nixpkgs.
* Break out a default.nix to make consuming this package easier
The flake is great for local development, but creates overhead and
duplication when pulling it in on another machine. With the default.nix,
the flake continues to work as before, but consumers can callPackage directly
with their own nixpkgs.
Fixes bd-160
The race was between Start() writing s.listener and Stop() reading it.
Now all listener access is protected by the server mutex:
- Start() stores listener under lock after creation
- Accept loop reads listener under RLock
- Stop() closes listener under lock
All RPC tests now pass with -race flag.
- MCP server now uses daemon client by default with CLI fallback
- Added BEADS_USE_DAEMON environment variable (default: enabled)
- Created multi-repo integration test (all tests pass)
- Updated .gitignore for daemon runtime files
- Added SETUP_DAEMON.md with migration instructions
- Closed bd-105 (investigation complete) and bd-114 (multi-server confusion)
This enables single MCP server to handle multiple repos via daemon
with per-request context routing. No more multiple MCP server configs!
Amp-Thread-ID: https://ampcode.com/threads/T-c222692e-f6ef-4649-9726-db59470b82ef
Co-authored-by: Amp <amp@ampcode.com>
- 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>
This is a fundamental architectural shift from binary SQLite to JSONL as
the source of truth for git workflows.
## New Features
- `bd export --format=jsonl` - Export issues to JSON Lines format
- `bd import` - Import issues from JSONL (create new, update existing)
- `--skip-existing` flag for import to only create new issues
## Architecture Change
**Before:** Binary SQLite database committed to git
**After:** JSONL text files as source of truth, SQLite as ephemeral cache
Benefits:
- Git-friendly text format with clean diffs
- AI-resolvable merge conflicts (append-only is 95% conflict-free)
- Human-readable issue tracking in git
- No binary merge conflicts
## Documentation
- Updated README with JSONL-first workflow and git hooks
- Added TEXT_FORMATS.md analyzing JSONL vs CSV vs binary
- Updated GIT_WORKFLOW.md with historical context
- .gitignore now excludes *.db, includes .beads/*.jsonl
## Implementation Details
- Export sorts issues by ID for consistent diffs
- Import handles both creates and updates atomically
- Proper handling of pointer fields (EstimatedMinutes)
- All tests passing
## Breaking Changes
- Database files (*.db) should now be gitignored
- Use export/import workflow for git collaboration
- Git hooks recommended for automation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Core features:
- Dependency-aware issue tracking with SQLite backend
- Ready work detection (issues with no open blockers)
- Dependency tree visualization
- Cycle detection and prevention
- Full audit trail
- CLI with colored output
Security and correctness fixes applied:
- Fixed SQL injection vulnerability in UpdateIssue (whitelisted fields)
- Fixed race condition in ID generation (added mutex)
- Fixed cycle detection to return full paths (not just issue IDs)
- Added cycle prevention in AddDependency (validates before commit)
- Added comprehensive input validation (priority, status, types, etc.)
- Fixed N+1 query in GetBlockedIssues (using GROUP_CONCAT)
- Improved query building in GetReadyWork (proper string joining)
- Fixed P0 priority filter bug (using Changed() instead of value check)
All critical and major issues from code review have been addressed.
🤖 Generated with Claude Code