Commit Graph

2200 Commits

Author SHA1 Message Date
Steve Yegge
7150d02502 bd daemon export: 2025-11-23 20:54:53 2025-11-23 20:54:53 -08:00
Steve Yegge
9ba039ce45 bd daemon export: 2025-11-23 20:51:15 2025-11-23 20:51:15 -08:00
Steve Yegge
d91560e260 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 20:51:11 -08:00
Steve Yegge
e8a752e707 Fix unvalidated dependency parsing in create.go
Validate dependsOnID is non-empty before setting discoveredFromParentID
to prevent attempting to fetch an issue with empty ID.

Also added validation to ensure parent issue exists before generating
child IDs in direct mode.

Fixes: bd-ia8r
2025-11-23 20:51:09 -08:00
Steve Yegge
3cf5e26d1e Implement auto-resolution of JSONL merge conflicts during bd sync
- Add isInRebase() to detect rebase state
- Add hasJSONLConflict() to check for JSONL-only conflicts
- Add runGitRebaseContinue() to continue rebase after resolution
- Auto-export from DB and resolve conflict when detected
- Add comprehensive tests for auto-resolution logic

Implements bd-cwmt
2025-11-23 20:41:35 -08:00
Steve Yegge
3ca11dc440 bd sync: 2025-11-23 20:41:25 2025-11-23 20:41:25 -08:00
Steve Yegge
144f4dea32 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 20:39:55 -08:00
Steve Yegge
c39243710c bd sync: apply DB changes after import 2025-11-23 20:38:42 -08:00
Steve Yegge
157d87ac8b Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 20:38:42 -08:00
Steve Yegge
8a2f910475 bd sync: 2025-11-23 20:38:41 2025-11-23 20:38:41 -08:00
Steve Yegge
4fd7933c10 bd sync: 2025-11-23 20:31:00
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 20:34:51 -08:00
Steve Yegge
d26f71bd31 bd daemon export: 2025-11-23 20:34:27 2025-11-23 20:34:27 -08:00
Steve Yegge
273a4d1cfc feat: Complete command set standardization (bd-au0)
Epic bd-au0: Command Set Standardization & Flag Consistency

Completed all 10 child issues:

P0 tasks:
- Standardize --dry-run flag across all commands (bd-au0.1)
- Add label operations to bd update (bd-au0.2)
- Fix --title vs --title-contains redundancy (bd-au0.3)
- Standardize priority flag parsing (bd-au0.4)

P1 tasks:
- Add date/priority filters to bd search (bd-au0.5)
- Add comprehensive filters to bd export (bd-au0.6)
- Audit and standardize JSON output (bd-au0.7)

P2 tasks:
- Improve clean vs cleanup documentation (bd-au0.8)
- Document rarely-used commands (bd-au0.9)

P3 tasks:
- Add global verbosity flags --verbose/-v and --quiet/-q (bd-au0.10)

Key changes:
- export.go: Added filters (assignee, type, labels, priority, dates)
- main.go: Added --verbose/-v and --quiet/-q global flags
- debug.go: Added SetVerbose/SetQuiet and PrintNormal helpers
- clean.go/cleanup.go: Improved documentation with cross-references
- detect_pollution.go: Added use cases and warnings
- migrate_hash_ids.go: Marked as legacy command
- rename_prefix.go: Added use cases documentation

All success criteria met: flags standardized, feature parity achieved,
naming clarified, JSON output consistent.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 20:33:31 -08:00
Steve Yegge
b5fb06c17d bd sync: apply DB changes after import 2025-11-23 20:32:54 -08:00
Steve Yegge
ea0900229b Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 20:32:54 -08:00
Steve Yegge
19098b92ee Fix unused variable in init.go
Remove unused yellow color variable that was causing build warning.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 20:32:49 -08:00
Steve Yegge
c765e6562d bd sync: 2025-11-23 20:24:44 2025-11-23 20:24:44 -08:00
Steve Yegge
58a71021ae bd sync: 2025-11-23 20:20:07 2025-11-23 20:24:40 -08:00
Steve Yegge
e07f1d43f7 bd sync: 2025-11-23 20:22:09 2025-11-23 20:22:09 -08:00
Steve Yegge
83246c8a2c Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 20:22:03 -08:00
Steve Yegge
e3e0a04496 Add configurable export error handling policies (bd-exug)
Implements flexible error handling for export operations with four policies:
- strict: Fail-fast on any error (default for user exports)
- best-effort: Skip errors with warnings (default for auto-exports)
- partial: Retry then skip with manifest tracking
- required-core: Fail on core data, skip enrichments

Key features:
- Per-project configuration via `bd config set export.error_policy`
- Separate policy for auto-exports: `auto_export.error_policy`
- Retry with exponential backoff (configurable attempts/delay)
- Optional export manifests documenting completeness
- Per-issue encoding error handling

This allows users to choose the right trade-off between data integrity
and system availability for their specific project needs.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 20:21:51 -08:00
Steve Yegge
83b8e38331 bd sync: 2025-11-23 20:21:05 2025-11-23 20:21:05 -08:00
Steve Yegge
44bf71d47e Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 20:16:18 -08:00
Steve Yegge
12187fcea3 bd sync: 2025-11-23 20:16:17 2025-11-23 20:16:17 -08:00
Steve Yegge
b6870de7f8 Fix: Change file permissions from 0644 to 0600 for security
The gosec linter (G302) requires file permissions to be 0600 or less
for security. Updated atomicWriteFile to use 0600 (owner read/write only)
instead of 0644 (world readable).

This affects config files written by bd setup commands (cursor, aider,
claude), making them only accessible by the owner.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 20:11:52 -08:00
Steve Yegge
c5210ff2a9 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 20:07:46 -08:00
Steve Yegge
afb6c7c8d8 bd sync: 2025-11-23 20:07:46 2025-11-23 20:07:46 -08:00
Steve Yegge
035b006e25 fix: Support both canonical and legacy JSONL filenames in merge driver check
The mergeDriverInstalled() function was only checking for the legacy
"beads.jsonl" filename, but installMergeDriver() writes the canonical
"issues.jsonl" filename. This caused false negatives where users with
the correct canonical configuration would be incorrectly flagged as
"not installed", potentially triggering unnecessary reinstalls.

Changes:
- Update mergeDriverInstalled() to check for both filenames
- Add test for canonical issues.jsonl filename detection
- Ensure existing correct configs are not unnecessarily overwritten

This fixes the inconsistency found during code review of bd-3sz0.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 20:07:26 -08:00
Steve Yegge
d9d0189e77 bd sync: apply DB changes after import 2025-11-23 19:58:21 -08:00
Steve Yegge
2d48ae1326 Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 19:58:21 -08:00
Steve Yegge
6222f970a6 bd sync: 2025-11-23 19:58:20 2025-11-23 19:58:20 -08:00
Steve Yegge
1c8dd49f17 fix: Auto-repair stale merge driver configs with invalid placeholders
Old bd versions (<0.24.0) installed merge driver with invalid %L/%R
placeholders. Git only supports %O (base), %A (current), %B (other).

Changes:
- mergeDriverInstalled() now detects %L/%R and returns false to trigger repair
- bd init automatically fixes stale configs during initialization
- bd doctor --fix also repairs stale configs
- Added comprehensive test coverage for auto-repair

Fixes: bd-3sz0
Epic: bd-tbz3 (all sub-issues now complete)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 19:56:38 -08:00
Steve Yegge
49830f7fbb bd sync: 2025-11-23 19:56:04 2025-11-23 19:56:38 -08:00
Steve Yegge
a1062fcf5f Fix: add missing yellow color function in init.go
The yellow color function was referenced but not defined, causing
CI build failures.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 19:55:59 -08:00
Steve Yegge
21c331baee Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 19:55:06 -08:00
Steve Yegge
6348417b5e bd sync: 2025-11-23 19:54:05 2025-11-23 19:54:05 -08:00
Steve Yegge
9c6b37500c Fix N+1 query pattern in export operations (bd-rcmg)
**Problem**: Export operations called GetLabels() and GetIssueComments()
in a loop for each issue, creating N+1 query pattern. For 100 issues
this created 201 queries instead of 3-5.

**Solution**:
- Added GetCommentsForIssues() batch method to storage interface
- Implemented batch method in SQLite and memory storage backends
- Updated handleExport() and triggerExport() to use batch queries
- Added comprehensive tests for batch operations

**Impact**: Query count reduced from ~201 to ~3-5 for 100 issues.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 19:53:44 -08:00
Steve Yegge
9d2dadbe87 Merge remote changes 2025-11-23 19:53:22 -08:00
Steve Yegge
ee11fb02d6 bd sync: 2025-11-23 19:52:59 2025-11-23 19:52:59 -08:00
Steve Yegge
b14853ac68 Merge branch 'main' of https://github.com/steveyegge/beads
# Conflicts:
#	.beads/beads.jsonl
2025-11-23 19:48:05 -08:00
Steve Yegge
77c407fd61 bd sync: 2025-11-23 19:47:32 2025-11-23 19:47:32 -08:00
Steve Yegge
a4c38d53b4 fix: Auto-configure sync.branch during bd init (bd-flil)
- bd init now auto-sets sync.branch to current git branch
- Fixes 'bd sync --status' error after fresh bd init
- Changed all branch detection to use 'git symbolic-ref' instead of 'git rev-parse' to work in fresh repos without commits
- Updated init.go, init_team.go, sync.go, version.go

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 19:42:21 -08:00
Steve Yegge
7e7d1dd702 bd sync: apply DB changes after import 2025-11-23 19:41:25 -08:00
Steve Yegge
db04f5bf3e Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 19:41:25 -08:00
Steve Yegge
c55485a4c8 bd sync: 2025-11-23 19:41:24 2025-11-23 19:41:24 -08:00
Steve Yegge
f6a79f6ceb bd sync: 2025-11-23 19:35:57 2025-11-23 19:35:57 -08:00
Steve Yegge
24965ebee2 fix: Remove duplicate context variable declarations in benchmark tests
Fixed compilation errors in benchmark test files where `ctx` was
declared twice, preventing benchmarks from running.

Changes:
- internal/storage/sqlite/bench_helpers_test.go: Remove duplicate ctx declaration
- internal/storage/sqlite/compact_bench_test.go: Remove duplicate ctx declaration

This allows `go test -tags=bench` to compile and run successfully.

Related to bd-5qim verification.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 19:35:52 -08:00
Steve Yegge
1d3d1f1c8b bd sync: apply DB changes after import 2025-11-23 19:25:39 -08:00
Steve Yegge
6cb950412a Merge branch 'main' of https://github.com/steveyegge/beads 2025-11-23 19:25:39 -08:00
Steve Yegge
ec4117d08a bd init: Default to YES for git hooks and merge driver
Fixes bd-bxha

Previously, bd init prompted users to install git hooks and merge driver,
which could result in incomplete setup if declined. Changed to install
both by default for better out-of-the-box experience.

Changes:
- Install git hooks automatically unless --skip-hooks is passed
- Install merge driver automatically unless --skip-merge-driver is passed
- Remove interactive prompts (no longer needed)
- Add warning messages on failure with suggestion to run bd doctor --fix
- Add --skip-hooks flag for explicit opt-out

Users who want to skip installation can now use:
  bd init --skip-hooks --skip-merge-driver

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 19:25:33 -08:00