Commit Graph

2734 Commits

Author SHA1 Message Date
Steve Yegge
975da2f6f9 bd sync: 2025-11-28 23:26:28 2025-11-28 23:26:28 -08:00
Steve Yegge
ad0babce96 bd sync: 2025-11-28 23:26:20 2025-11-28 23:26:28 -08:00
Steve Yegge
d6f19d71f7 bd sync: apply DB changes after import 2025-11-28 23:26:24 -08:00
Steve Yegge
0d6298f2d3 docs: add performance testing guide (bd-zj8e)
Created docs/PERFORMANCE_TESTING.md with comprehensive coverage of:
- Running benchmarks (make bench, make bench-quick)
- Running specific benchmarks
- Understanding benchmark output (ns/op, allocs/op)
- CPU profiling with pprof and flamegraphs
- Memory profiling
- User diagnostics (bd doctor --perf)
- Comparing performance with benchstat
- Optimization tips and common patterns

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 23:26:24 -08:00
Steve Yegge
24999931a5 bd sync: 2025-11-28 23:25:41 2025-11-28 23:25:41 -08:00
Steve Yegge
7a38cb2d6b bd sync: 2025-11-28 23:25:34 2025-11-28 23:25:41 -08:00
Steve Yegge
65e8fa14f8 bd sync: apply DB changes after import 2025-11-28 23:20:15 -08:00
Steve Yegge
9b86e8ba10 bd sync: apply DB changes after import 2025-11-28 23:20:10 -08:00
Steve Yegge
608eeb82ec bd sync: 2025-11-28 23:19:26 2025-11-28 23:19:26 -08:00
Steve Yegge
a5ec5c6977 feat(bd-1pj6): Add custom status states via config
Users can now define custom status states for multi-step pipelines using:
  bd config set status.custom "awaiting_review,awaiting_testing,awaiting_docs"

Changes:
- Add Status.IsValidWithCustom() method for custom status validation
- Add Issue.ValidateWithCustomStatuses() method
- Add GetCustomStatuses() method to storage interface
- Update CreateIssue/UpdateIssue to support custom statuses
- Add comprehensive tests for custom status functionality
- Update config command help text with custom status documentation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 23:19:21 -08:00
Steve Yegge
26f84b6a47 bd sync: 2025-11-28 23:19:01 2025-11-28 23:19:21 -08:00
Steve Yegge
ce53a4373c bd sync: 2025-11-28 23:15:17 2025-11-28 23:15:17 -08:00
Steve Yegge
f269554b72 bd sync: apply DB changes after import 2025-11-28 23:14:45 -08:00
Steve Yegge
061d11d138 bd sync: apply DB changes after import 2025-11-28 23:14:12 -08:00
Steve Yegge
f59f8c20d0 refactor: rename last_import_hash to jsonl_content_hash (bd-39o)
The metadata key 'last_import_hash' was misleading because it's updated on
both import AND export. Renamed to 'jsonl_content_hash' which more accurately
describes its purpose - tracking the content hash of the JSONL file.

Added migration support: read operations try new key first, then fall back
to old key for backwards compatibility with existing databases.

Files modified:
- cmd/bd/integrity.go: Update key name with migration support
- cmd/bd/import.go: Update key name
- cmd/bd/sync.go: Update key name
- cmd/bd/autoflush.go: Update key name with migration support
- cmd/bd/daemon_sync.go: Update key name
- cmd/bd/daemon_event_loop.go: Update key name with migration support
- internal/autoimport/autoimport.go: Update key name with migration support
- Updated all related tests

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 23:14:12 -08:00
Steve Yegge
bca8022bee bd sync: 2025-11-28 23:13:57 2025-11-28 23:14:12 -08:00
Steve Yegge
7fb2122601 bd sync: apply DB changes after import 2025-11-28 23:12:58 -08:00
Steve Yegge
9abe99e05a docs(UX): improve daemon and merge documentation (bd-bt6y)
- Clarify bd merge help text: git merge driver, not for duplicate issues
- Add Do I Need the Daemon section to DAEMON.md
- Add daemon overview section to QUICKSTART.md

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 23:11:24 -08:00
Steve Yegge
51db4c8212 bd sync: 2025-11-28 23:10:52 2025-11-28 23:11:00 -08:00
Steve Yegge
39909c1f80 feat: implement health checks in daemon event loop (bd-gqo)
Add health checks to checkDaemonHealth() function:
- Database integrity check using PRAGMA quick_check(1)
- Disk space check with 100MB warning threshold (platform-specific)
- Memory usage check with 500MB heap warning threshold

Platform-specific disk space implementations:
- Unix: uses unix.Statfs
- Windows: uses windows.GetDiskFreeSpaceEx
- WASM: returns unsupported (false)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 23:10:44 -08:00
Steve Yegge
5882a2f105 bd sync: 2025-11-28 23:10:29 2025-11-28 23:10:35 -08:00
Steve Yegge
3ccfc8e6ad bd sync: 2025-11-28 23:09:20 2025-11-28 23:09:21 -08:00
Steve Yegge
9efd31de5f bd-o2e: Add --squash flag to bd sync for batching commits
For solo developers who don't need real-time multi-agent coordination,
--squash accumulates changes in JSONL without committing. Run 'bd sync'
later (without --squash) to commit all accumulated changes in one commit.

This reduces git history noise while preserving the default behavior
needed for multi-agent orchestration.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 23:09:20 -08:00
Steve Yegge
116acd4698 bd sync: 2025-11-28 23:09:11 2025-11-28 23:09:11 -08:00
Steve Yegge
70dc0704af bd sync: 2025-11-28 23:08:50 2025-11-28 23:09:05 -08:00
Steve Yegge
4c713e03ff bd sync: 2025-11-28 23:08:12 2025-11-28 23:08:12 -08:00
Steve Yegge
12b678058a bd sync: 2025-11-28 23:08:01 2025-11-28 23:08:08 -08:00
Steve Yegge
40b07045c7 refactor: deduplicate FindJSONLInDir function (bd-8a5)
Extract shared JSONL file discovery logic to internal/utils/path.go.
Both autoimport and beads packages now use this shared implementation.

Changes:
- Add utils.FindJSONLInDir with common logic
- Update autoimport.go to use utils.FindJSONLInDir
- Update beads.go to delegate to utils.FindJSONLInDir
- Update server_export_import_auto.go to use utils.FindJSONLInDir
- Move FindJSONLInDir test to utils/path_test.go
- Fix pre-existing duplicate countIssuesInJSONLFile in init.go

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 23:07:53 -08:00
Steve Yegge
52fe60859a bd sync: 2025-11-28 23:07:13 2025-11-28 23:07:30 -08:00
Steve Yegge
93b1c47e54 bd sync: apply DB changes after import 2025-11-28 23:04:22 -08:00
Steve Yegge
4ef5a28afc bd sync: 2025-11-28 22:17:18 2025-11-28 22:17:18 -08:00
Steve Yegge
01dde64b82 bd sync: apply DB changes after import 2025-11-28 22:17:12 -08:00
Steve Yegge
b7ed7b376e bd sync: 2025-11-28 22:16:11 2025-11-28 22:16:11 -08:00
Steve Yegge
6f9d8d3add bd-c8x: Stop searching parent directories at git root
Directory discovery (FindBeadsDir, findDatabaseInTree, FindAllDatabases)
now stops at the git repository root to avoid finding unrelated databases
in parent directories (e.g., ~/.beads).

Added findGitRoot() helper that uses 'git rev-parse --show-toplevel'.

Also updated TestCheckDatabaseVersionJSONLMode to properly simulate
no-db mode by creating config.yaml with 'no-db: true'.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 22:16:11 -08:00
Steve Yegge
69e724f2ae bd sync: 2025-11-28 22:15:45 2025-11-28 22:15:45 -08:00
Steve Yegge
13b2ab6c95 feat(doctor): add fresh clone detection check (bd-4ew)
Add CheckFreshClone function that detects when JSONL contains issues
but no database exists. Recommends 'bd init --prefix <detected-prefix>'
to hydrate the database. This check appears early in doctor output
to guide users on fresh clones.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 22:15:34 -08:00
Steve Yegge
675b7a43b7 bd sync: 2025-11-28 22:14:57 2025-11-28 22:15:34 -08:00
Steve Yegge
3a4840169d fix(init): add safety guard to prevent overwriting existing data
bd init now refuses when:
- JSONL file exists with >0 issues (fresh clone scenario)
- Database file already exists (already initialized)

Suggests `bd doctor --fix` for fresh clones and provides clear guidance.
Added --force flag to bypass the safety guard when needed.

Closes: bd-emg

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 22:15:13 -08:00
Steve Yegge
a34c56c43a bd sync: 2025-11-28 22:14:57 2025-11-28 22:15:04 -08:00
Steve Yegge
46862568f6 bd-4ew: Doctor detects fresh clone and recommends 'bd init'
When JSONL exists but no database (and not no-db mode), doctor now:
- Shows 'Fresh clone detected' warning
- Shows count of issues in JSONL
- Recommends 'bd init' with detected prefix

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 21:59:59 -08:00
Steve Yegge
d782574667 bd sync: 2025-11-28 21:57:22 2025-11-28 21:57:22 -08:00
Steve Yegge
82595468a6 bd sync: 2025-11-28 21:57:15 2025-11-28 21:57:22 -08:00
Steve Yegge
247672be54 test: improve coverage for config and git packages
- config: Add tests for GetStringSlice, GetMultiRepoConfig, and nil viper
  behavior. Coverage improved from 65.3% to 84.0%.
- git: Add tests for error paths in RemoveBeadsWorktree, SyncJSONLToWorktree,
  CheckWorktreeHealth, and sparse checkout functions. Coverage improved
  from 72.9% to 82.7%.

Closes: bd-t3b, bd-4h3, bd-ge7

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 21:56:52 -08:00
Steve Yegge
61c61d5957 bd sync: 2025-11-28 21:56:17 2025-11-28 21:56:52 -08:00
Steve Yegge
9d896c3b28 bd-bok: Add --yes/-y flag to bd doctor --fix for non-interactive mode
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 21:56:33 -08:00
Steve Yegge
284d61420e bd sync: 2025-11-28 21:56:19 2025-11-28 21:56:19 -08:00
Steve Yegge
898d586329 bd sync: 2025-11-28 21:54:46 2025-11-28 21:54:46 -08:00
Steve Yegge
c9d6c434b6 bd sync: 2025-11-28 21:54:38 2025-11-28 21:54:45 -08:00
Steve Yegge
e18a75347b bd sync: 2025-11-28 21:53:48 2025-11-28 21:53:48 -08:00
Steve Yegge
eeab5e55e3 test(doctor): add test for beads.base.jsonl merge artifacts (bd-ov1)
Verify that beads.base.jsonl and beads.left.jsonl patterns are correctly
excluded from the 'multiple JSONL files' warning, same as issues.base.jsonl.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 21:52:48 -08:00