Commit Graph

1275 Commits

Author SHA1 Message Date
Steve Yegge
fd93a29ab5 Add 'bd status' command for issue database overview (bd-28db)
Implement a new `bd status` command that provides a quick snapshot of the
issue database state, similar to how `git status` shows working tree state.

Features:
- Summary counts by state (open, in-progress, blocked, closed)
- Ready to work count
- Recent activity stats (last 7 days): created, closed, updated issues
- Support for --assigned flag to filter by current user
- JSON output format with --json flag
- Comprehensive test coverage

Usage examples:
  bd status                # Show summary
  bd status --json         # JSON output
  bd status --assigned     # Filter to assigned issues
  bd status --no-daemon    # Direct mode with recent activity

Note: Recent activity currently only works in direct mode (--no-daemon).
Daemon mode support marked with TODO for future enhancement.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 17:57:59 -08:00
Steve Yegge
0539455b2d Merge remote changes to beads.jsonl 2025-11-02 17:32:29 -08:00
Steve Yegge
386b15b385 bd sync: 2025-11-02 17:31:45 2025-11-02 17:31:45 -08:00
Steve Yegge
0883fa3c84 Merge branch 'main' of github.com:steveyegge/beads 2025-11-02 17:25:13 -08:00
Steve Yegge
5b1f9a683c bd sync: 2025-11-02 17:20:26 2025-11-02 17:20:45 -08:00
Steve Yegge
01f13a6c18 Add 'bd comment' as alias for 'bd comments add' (bd-d3f0)
Implements a shorter, more natural syntax for adding comments to issues.
Users can now use 'bd comment <issue-id> <text>' instead of the more
verbose 'bd comments add <issue-id> <text>'.

Changes:
- cmd/bd/comments.go: Add commentCmd as top-level alias
- cmd/bd/comments_test.go: Add TestCommentAlias for verification
- commands/comments.md: Document the new shortcut

The alias delegates to the existing commentsAddCmd implementation,
ensuring all functionality (--file, --author flags) works identically.
Backwards compatibility is maintained - 'bd comments add' continues to work.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 17:20:45 -08:00
Steve Yegge
1880278905 Merge remote-tracking branch 'origin/main' 2025-11-02 17:20:35 -08:00
Steve Yegge
50cb2739c8 Import beads JSONL updates 2025-11-02 17:17:11 -08:00
Steve Yegge
e3a7a95831 bd sync: 2025-11-02 17:15:30 2025-11-02 17:15:42 -08:00
Steve Yegge
0599cb732f Fix bd doctor --json flag not working (bd-6049)
The --json flag was being ignored because doctor.go defined a local
flag that shadowed the persistent --json flag from main.go. The local
flag wasn't bound to the global jsonOutput variable, so it remained
false even when --json was passed.

Fixed by removing the duplicate local flag definition. The doctor
command now correctly uses the global persistent flag.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 17:14:22 -08:00
Steve Yegge
31c39f17d5 bd sync: 2025-11-02 17:12:48
Track bd-ad5e: Add AI planning docs management guidance to bd onboard

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 17:12:48 -08:00
Steve Yegge
edb9c9e2ab Add panic recovery to RPC handleConnection (bd-1048) 2025-11-02 17:11:52 -08:00
Steve Yegge
fa5fd1bd4e Add test issue 2025-11-02 17:11:52 -08:00
Steve Yegge
d46177d885 Enhance bd onboard with AI planning docs management guidance
Add comprehensive guidance for managing AI-generated planning documents
(Claude slop) to the bd onboard command. Addresses GitHub issue #196.

Changes:
- Add Managing AI-Generated Planning Documents section to onboard output
- Recommend using history/ directory for ephemeral planning files
- List common planning doc types (PLAN.md, IMPLEMENTATION.md, etc.)
- Provide .gitignore example and benefits explanation
- Add to Important Rules: Store AI planning docs in history/
- Update AGENTS.md with the same guidance to demonstrate the pattern
- Add comprehensive tests for onboard command

This uses inverted control: bd outputs guidance, AI agents intelligently
integrate it into their project's documentation (AGENTS.md, CLAUDE.md,
.cursorrules, etc.), respecting existing conventions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 17:10:41 -08:00
Steve Yegge
dfc8e48b57 Add git hooks check to bd doctor
- Adds checkGitHooks() function to verify recommended hooks are installed
- Checks for pre-commit, post-merge, and pre-push hooks
- Warns if hooks are missing with install instructions
- Shows up early in diagnostics (even if .beads/ missing)
- Includes comprehensive test coverage
- Filed bd-6049 for broken --json flag

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 17:09:39 -08:00
Steve Yegge
6353873e72 bd sync: 2025-11-02 17:08:39 2025-11-02 17:09:39 -08:00
Steve Yegge
1f90f4693a bd sync: 2025-11-02 17:05:09 2025-11-02 17:05:09 -08:00
Steve Yegge
1451e4e25f bd sync: 2025-11-02 17:03:39 2025-11-02 17:03:39 -08:00
Steve Yegge
25ef5a7ef6 Implement bd daemons restart command
Adds restart subcommand to bd daemons that gracefully stops a daemon
and starts a new one in the same workspace.

Features:
- Accepts workspace path or PID as target
- Graceful shutdown via RPC with SIGTERM fallback
- Starts new daemon with exec.Cmd in correct workspace directory
- Prefers workspace-local bd binary if present
- Supports --search and --json flags
- Proper error handling and user feedback

Closes bd-3ee2c7e9 (bd daemons command epic)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 16:59:40 -08:00
Steve Yegge
4ee5b2c2c1 Add conflict marker detection to bd import/validate
- bd import now detects git conflict markers and shows resolution steps
- bd validate --checks=conflicts improved with clearer instructions
- Updated AGENTS.md with better conflict resolution docs
- Closes bd-7e7ddffa epic (repair tools complete)

Amp-Thread-ID: https://ampcode.com/threads/T-4a11a65b-56c2-4d92-8f68-66f0a56ab5e3
Co-authored-by: Amp <amp@ampcode.com>
2025-11-02 16:45:51 -08:00
Steve Yegge
439f09a255 bd sync: 2025-11-02 16:43:24 2025-11-02 16:43:24 -08:00
Steve Yegge
ec8289e4a9 bd sync: 2025-11-02 16:40:27 2025-11-02 16:40:27 -08:00
Steve Yegge
712fb772fe Complete sync branch daemon tests (bd-7bd2, bd-502e)
- Add daemon_sync_branch.go with syncBranchCommitAndPush/Pull functions
- Add daemon_sync_branch_test.go with 7 comprehensive tests
- All tests passing: NotConfigured, Success, NoChanges, WorktreeHealthCheck, Pull, EndToEnd
- Key fix: initMainBranch must run BEFORE creating issues/JSONL
- Close bd-7bd2 and bd-502e

Amp-Thread-ID: https://ampcode.com/threads/T-e3d7ba22-99d1-4210-a6db-1dcc3bdd622b
Co-authored-by: Amp <amp@ampcode.com>
2025-11-02 16:40:21 -08:00
Steve Yegge
b1ec428dae bd sync: 2025-11-02 16:40:03 2025-11-02 16:40:03 -08:00
Steve Yegge
178a43dd5d Add external_ref UNIQUE constraint and validation
- Add migration for UNIQUE index on external_ref column (bd-897a)
- Add validation for duplicate external_ref in batch imports (bd-7315)
- Add query planner test to verify index usage (bd-f9a1)
- Add concurrent import tests for external_ref (bd-3f6a)

The migration detects existing duplicates and fails gracefully.
Batch imports now reject duplicates with clear error messages.
Tests verify the index is actually used by SQLite query planner.

Amp-Thread-ID: https://ampcode.com/threads/T-45ca66ed-3912-46c4-963c-caa7724a9a2f
Co-authored-by: Amp <amp@ampcode.com>
2025-11-02 16:27:42 -08:00
Steve Yegge
10029d0baf bd sync: 2025-11-02 16:24:39 2025-11-02 16:24:39 -08:00
Steve Yegge
3ae3e5b2cb Optimize test suite performance (bd-e05d)
- Gate slow git E2E tests with testing.Short() (saves ~5s)
- Use shallow/shared clones for test repos
- Disable git hooks in test setup (major speedup)
- Reduce sync rounds from 3→1 (2 for dedup test)
- Add git speed configs (gc.auto=0, fsync=false, gpgSign=false)

Results:
- cmd/bd tests: 41s → 33s with -short (~20% faster)
- Full suite: >300s timeout → ~40s (no timeout!)
- E2E tests: 2-3s each → skipped with -short

Run full E2E tests with: go test ./...
Run fast tests with: go test -short ./...
2025-11-02 16:24:35 -08:00
Steve Yegge
248cce454c Document and enforce private memory test isolation pattern (bd-2e80)
- Update newTestStore to default to private memory mode
- Add comprehensive documentation explaining test isolation
- Prevents shared :memory: database interference between tests

Amp-Thread-ID: https://ampcode.com/threads/T-97b59814-3d1a-4f32-bcd2-07a7b81c2b65
Co-authored-by: Amp <amp@ampcode.com>
2025-11-02 16:04:36 -08:00
Steve Yegge
32a865038d bd sync: 2025-11-02 16:04:23 2025-11-02 16:04:23 -08:00
Steve Yegge
15c86b774c bd sync: 2025-11-02 15:55:58 2025-11-02 15:55:58 -08:00
Steve Yegge
bdd4d1832d bd sync: 2025-11-02 15:35:22 2025-11-02 15:51:06 -08:00
Steve Yegge
4d3a39aaa3 bd sync: 2025-11-02 15:35:01 2025-11-02 15:51:06 -08:00
Steve Yegge
7e5b382161 Only flush JSONL on import if there were actual changes
Avoid unnecessary I/O when import has no updates
2025-11-02 15:50:37 -08:00
Steve Yegge
8ba063a4f2 Update beads.jsonl (bd-a4b5 closed) 2025-11-02 15:49:36 -08:00
Steve Yegge
c6bf6331ec Implement git worktree management with sparse checkout (bd-a4b5)
- Created internal/git package with WorktreeManager
- Implements CreateBeadsWorktree with sparse checkout (.beads/ only)
- Implements RemoveBeadsWorktree with cleanup and pruning
- Implements CheckWorktreeHealth with repair capability
- Implements SyncJSONLToWorktree for JSONL syncing
- Comprehensive tests with 100% coverage
- Handles symlinks correctly (macOS /tmp -> /private/tmp)
- Idempotent worktree creation
- Sparse checkout excludes all files except .beads/
2025-11-02 15:49:36 -08:00
Steve Yegge
5aaa9ed8f5 bd sync: 2025-11-02 15:47:54 2025-11-02 15:47:54 -08:00
Steve Yegge
8a04cd3382 Fix bd-47f1: bd import now flushes JSONL immediately for daemon visibility
- Changed bd import to call flushToJSONL() instead of markDirtyAndScheduleFlush()
- Ensures daemon FileWatcher detects changes within ~500ms instead of up to 30s
- Fixes race condition where MCP daemon served stale data after CLI import
2025-11-02 15:47:45 -08:00
Steve Yegge
18bd4f9630 bd sync: 2025-11-02 15:39:07 2025-11-02 15:39:07 -08:00
Steve Yegge
94fc772139 Fix gosec warnings: tighten file permissions and add exclusions (bd-b47c034e) 2025-11-02 15:39:00 -08:00
Steve Yegge
334ef713b7 Merge commit 'ebfb94e' 2025-11-02 15:38:51 -08:00
Steve Yegge
ebfb94ea52 bd sync: 2025-11-02 15:37:49 2025-11-02 15:38:47 -08:00
Steve Yegge
f73651a2b5 Add sync.branch configuration support (bd-b7d2)
- Created internal/syncbranch package with validation and env var support
- Added --branch flag to bd init command
- Enhanced bd config get/set to validate sync.branch
- Added BEADS_SYNC_BRANCH environment variable support
- Comprehensive tests for branch name validation
- Supports precedence: env var > database config > empty (current branch)
2025-11-02 15:37:57 -08:00
Steve Yegge
9bb293e2e1 bd sync: 2025-11-02 15:37:49 2025-11-02 15:37:49 -08:00
Steve Yegge
0bf60f3a09 bd sync: 2025-11-02 15:36:50 2025-11-02 15:36:58 -08:00
Steve Yegge
065a22bb69 bd sync: 2025-11-02 15:35:05 2025-11-02 15:35:05 -08:00
Steve Yegge
f4628f62a6 bd sync: 2025-11-02 15:33:57 2025-11-02 15:33:57 -08:00
Steve Yegge
d8c66f53da bd sync: 2025-11-02 15:32:34 2025-11-02 15:32:34 -08:00
Steve Yegge
a3aeaf5102 bd sync: 2025-11-02 15:30:16 2025-11-02 15:30:16 -08:00
Steve Yegge
3a210cd369 bd sync: 2025-11-02 15:28:14 2025-11-02 15:28:14 -08:00
Steve Yegge
55c722a3e3 Implement external_ref as primary matching key for import updates (bd-1022)
- Add GetIssueByExternalRef() query function to storage interface and implementations
- Update DetectCollisions() to prioritize external_ref matching over ID matching
- Modify upsertIssues() to handle external_ref matches in import logic
- Add index on external_ref column for performance
- Add comprehensive tests for external_ref matching in both collision detection and import
- Enables re-syncing from external systems (Jira, GitHub, Linear) without duplicates
- Preserves local issues (no external_ref) from being overwritten
2025-11-02 15:28:09 -08:00