Commit Graph

438 Commits

Author SHA1 Message Date
Steve Yegge
d5dde7c753 bd sync: 2025-11-02 21:58:16 2025-11-02 21:58:16 -08:00
Steve Yegge
43fd90b61a Update beads issue database
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 18:42:48 -08:00
Steve Yegge
9f9167c5db bd sync: 2025-11-02 18:35:59 2025-11-02 18:36:30 -08:00
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
c5b2fbbc9d Add comprehensive sync-branch test coverage (bd-0e74)
Added 4 new integration tests to ensure sync-branch workflow is robust:

1. TestSyncBranchConfigChange - Validates changing sync.branch config
   after worktrees exist. Tests smooth transition between branches.

2. TestSyncBranchMultipleConcurrentClones - Tests 3-way clone sync
   workflow. Simulates real multi-agent collaboration scenario.

3. TestSyncBranchPerformance - Validates commit overhead < 150ms.
   Current performance: avg 77ms (well within target).

4. TestSyncBranchNetworkFailure - Tests graceful handling of network
   errors during push. Ensures local commits succeed even when remote
   is unreachable.

All tests pass:
- cmd/bd (sync branch): PASS (5.361s)
- internal/git: PASS (1.071s)
- internal/syncbranch: PASS (0.312s)

Test coverage now includes: config change handling, multiple concurrent
clones, network failure recovery, performance validation, fresh setup,
issue operations, error handling, sparse checkout.

Closes bd-0e74

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 18:30:38 -08:00
Steve Yegge
b0513d8d1e Update beads issue database
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 18:18:44 -08:00
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
386b15b385 bd sync: 2025-11-02 17:31:45 2025-11-02 17:31:45 -08:00
Steve Yegge
e3a7a95831 bd sync: 2025-11-02 17:15:30 2025-11-02 17:15:42 -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
fa5fd1bd4e Add test issue 2025-11-02 17:11:52 -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
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
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
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
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
18bd4f9630 bd sync: 2025-11-02 15:39:07 2025-11-02 15:39:07 -08:00
Steve Yegge
9bb293e2e1 bd sync: 2025-11-02 15:37:49 2025-11-02 15:37:49 -08:00
Steve Yegge
8c5d2373bd bd sync: 2025-11-02 15:27:00 2025-11-02 15:27:01 -08:00
Steve Yegge
756e4622cf bd sync: Add bd-a101 epic and 7 child issues for separate branch support 2025-11-02 15:23:20 -08:00
Steve Yegge
7ba3fd59d3 Remove separate-branch-epic.md - filed as bd-a101 epic with 7 child issues 2025-11-02 15:22:58 -08:00
Steve Yegge
c3e3aa4949 bd sync: 2025-11-02 14:49:34 2025-11-02 14:49:34 -08:00
Steve Yegge
a488b8a082 bd sync: 2025-11-02 14:38:24 2025-11-02 14:49:27 -08:00
Steve Yegge
cb179169e4 bd sync: 2025-11-02 14:36:37 2025-11-02 14:36:37 -08:00
Steve Yegge
8997fbbbc7 Merge branch 'main' of github.com:steveyegge/beads 2025-11-02 14:31:24 -08:00
Steve Yegge
0215e73780 Fix config system: rename config.json → metadata.json, fix config.yaml loading
- Renamed config.json to metadata.json to clarify purpose (database metadata)
- Fixed config.yaml/config.json conflict by making Viper explicitly load only config.yaml
- Added automatic migration from config.json to metadata.json on first read
- Fixed jsonOutput variable shadowing across 22 command files
- Updated bd init to create both metadata.json and config.yaml template
- Fixed 5 failing JSON output tests
- All tests passing

Resolves config file confusion and makes config.yaml work correctly.
Closes #178 (global flags), addresses config issues from #193

Amp-Thread-ID: https://ampcode.com/threads/T-e6ac8192-e18f-4ed7-83bc-4a5986718bb7
Co-authored-by: Amp <amp@ampcode.com>
2025-11-02 14:31:22 -08:00
Steve Yegge
b627b0c84b bd sync: 2025-11-02 14:21:09 2025-11-02 14:21:09 -08:00
Steve Yegge
c810a494c6 bd sync: 2025-11-02 14:03:00 2025-11-02 14:03:00 -08:00
Steve Yegge
10b89d66b0 bd sync: apply rename detection from import 2025-11-02 13:11:26 -08:00
Steve Yegge
d1e022d684 bd sync: 2025-11-02 13:11:24 2025-11-02 13:11:26 -08:00
Steve Yegge
233af06c85 bd sync: apply rename detection from import 2025-11-02 12:56:00 -08:00
Steve Yegge
229b92b6a8 Merge branch 'main' of github.com:steveyegge/beads 2025-11-02 12:55:59 -08:00
Steve Yegge
dfd2ad6e75 bd sync: 2025-11-02 12:55:58 2025-11-02 12:55:58 -08:00
Steve Yegge
2ab65d2c79 bd sync: 2025-11-02 12:40:49 2025-11-02 12:40:49 -08:00
Steve Yegge
79fa6d2fec bd sync: 2025-11-02 12:32:23 2025-11-02 12:32:29 -08:00
Steve Yegge
130b8eee28 bd sync: apply rename detection from import 2025-11-02 12:32:00 -08:00
Steve Yegge
525b6d4a78 Merge branch 'main' of github.com:steveyegge/beads 2025-11-02 12:31:59 -08:00
Steve Yegge
4387757369 bd sync: 2025-11-02 12:31:58 2025-11-02 12:31:58 -08:00