Commit Graph

2941 Commits

Author SHA1 Message Date
Steve Yegge
045591aff7 chore: Bump version to 0.28.0
Updated all component versions:
- bd CLI: 0.27.2 → 0.28.0
- Plugin: 0.27.2 → 0.28.0
- MCP server: 0.27.2 → 0.28.0
- npm package: 0.27.2 → 0.28.0
- Documentation: 0.27.2 → 0.28.0

Generated by scripts/bump-version.sh
2025-12-01 22:34:42 -08:00
Steve Yegge
1a48fa197c docs: prepare v0.28.0 release notes
- Add v0.28.0 entry to CHANGELOG.md with all changes
- Add v0.28.0 to info.go whats-new section
- Trim old versions (0.21.0, 0.22.x) from whats-new
2025-12-01 22:33:23 -08:00
Steve Yegge
e5c3f8b45a fix(test): use --local flag in git config check for merge driver test
The test was picking up global git config when checking that --skip-merge-driver
didn't set the merge.beads.driver config locally.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 22:12:39 -08:00
Steve Yegge
a4260c9660 fix(db): remove redundant GetCloseReason() calls (bd-bbh)
After adding close_reason column to issues table, two functions still
called GetCloseReason() to fetch from events table after already
scanning the column. Removed the redundant code.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 22:06:08 -08:00
Steve Yegge
09fffa4eaf fix(db): add close_reason column to issues table (bd-uyu)
- Add migration 017_close_reason_column.go to create the column
- Update all INSERT statements to include close_reason
- Update all SELECT statements to include close_reason
- Update doctor.go to check for close_reason in schema validation
- Remove workaround code that batch-loaded close reasons from events table
- Fix migrations_test.go to include close_reason in test table schema

This fixes sync loops where close_reason values were silently dropped
because the DB lacked the column despite the struct having the field.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:56:41 -08:00
Steve Yegge
d880fceb0f fixed GH issue #444 2025-12-01 21:26:25 -08:00
Steve Yegge
096e51a8b8 bd sync: 2025-12-01 21:24:52 2025-12-01 21:25:06 -08:00
Steve Yegge
a2d1edd865 fix(multi-repo): filter issues by prefix when flushing from non-primary repos (GH #437)
In multi-repo mode, non-primary repos incorrectly wrote ALL issues to their
local issues.jsonl, including foreign issues from other repos. This caused
prefix mismatch errors on subsequent imports.

The fix adds prefix filtering in flushToJSONLWithState() when:
1. Multi-repo mode is configured (repos.primary set)
2. Current repo is not the primary repo
3. The repo has a configured issue_prefix

Issues not matching the local prefix are filtered out before writing to JSONL.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:17:56 -08:00
Steve Yegge
64ef220dee feat(cli): add --estimate flag to bd create and bd update commands
Add CLI support for the estimated_minutes field that was already in the
Issue schema but had no way to be set from the command line.

Changes:
- Add --estimate flag to bd create (set estimated time on new issues)
- Add --estimate flag to bd update (modify estimated time on existing issues)
- Add EstimatedMinutes field to RPC CreateArgs and UpdateArgs
- Add handling in daemon RPC handlers for the new field

Example usage:
  bd create --title "Task" --estimate 60    # 60 minutes estimate
  bd update bd-abc --estimate 120           # update to 2 hours

Fixes GH #443

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:13:51 -08:00
Steve Yegge
7ea8555bc8 bd sync: update bd-3s8 with description and move to open 2025-12-01 21:12:10 -08:00
Steve Yegge
2d12a080d7 Refactor daemon sync functions to reduce duplication (bd-73u)
Extract shared performSync implementation with skipGit parameter:
- createSyncFunc and createLocalSyncFunc now delegate to performSync
- Follows same pattern as performExport and performAutoImport
- Reduces ~80 lines of duplicated code

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:10:56 -08:00
Steve Yegge
d90936116d docs: add go install fallback for Claude Code web (GH #439)
Add documentation for users experiencing npm postinstall failures in Claude Code web environments due to network restrictions.

Closes: bd-8q0

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:10:03 -08:00
Steve Yegge
d045da4f13 feat(daemon): add --foreground flag for systemd/supervisord integration
Adds --foreground flag to 'bd daemon --start' that runs the daemon in
foreground instead of forking to background. This enables management by
process supervisors like systemd, supervisord, or similar tools.

Usage: bd daemon --start --foreground

Closes #438

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:09:00 -08:00
Steve Yegge
6ebf7d9538 bd sync: 2025-12-01 21:07:46 2025-12-01 21:08:05 -08:00
Steve Yegge
34c370f0e7 refactor(daemon): consolidate sync functions to reduce duplication
Consolidate createSyncFunc and createLocalSyncFunc into a shared
performSync function, following the same pattern used for:
- performExport (used by createExportFunc and createLocalExportFunc)
- performAutoImport (used by createAutoImportFunc and createLocalAutoImportFunc)

The new performSync takes a skipGit bool parameter that skips all git
operations (commits, pulls, pushes) and 3-way merge when true.

This reduces ~60 lines of duplicated code and provides a single
implementation to maintain.

Closes: bd-73u

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:07:52 -08:00
Steve Yegge
0456e784f4 fix(deps): improve parent-child dependency UX (GH #440)
- Fix DEPENDENCIES.md: correct parent-child syntax (child depends on parent)
- Update bd show: display Children instead of Blocks for parent-child deps
- Group dependents by type with distinct labels

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:07:23 -08:00
Steve Yegge
4c5d90cf46 bd sync: track issue bd-hm8 completion 2025-12-01 21:05:44 -08:00
Steve Yegge
3de3b60b45 Add uninstall documentation (GH #445)
- Create docs/UNINSTALLING.md with comprehensive uninstall steps
- Add link to UNINSTALLING.md from INSTALLING.md
- Cover: daemon, hooks, merge driver, .beads dir, worktree cleanup

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:05:19 -08:00
Steve Yegge
d213ec912b fix(jira): migrate from deprecated API v2 to v3
Fixes #441. The JIRA REST API v2 /search endpoint has been deprecated
and returns HTTP 410 Gone. Migrate to API v3 /search/jql endpoint.

Changes:
- Update API endpoint from /rest/api/2/search to /rest/api/3/search/jql
- Add URL encoding for JQL query parameter (Python 3.14 compatibility)
- Add reference to Atlassian migration guide

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 21:02:20 -08:00
Steve Yegge
2300514424 bd sync: 2025-12-01 21:00:26 2025-12-01 21:00:26 -08:00
Steve Yegge
8ef3d81108 fix(sync): prevent final flush after sync.branch restore
When sync.branch is configured, the sync command:
1. Exports changes to JSONL
2. Commits to sync branch via worktree
3. Pulls from sync branch
4. Restores .beads/ from HEAD to keep working directory clean

But PersistentPostRun's flushManager.Shutdown() was re-exporting to JSONL,
undoing the restore and leaving modified files.

Fix: Set skipFinalFlush flag when sync.branch mode completes successfully.
This prevents the final export in PersistentPostRun.

Also: Skip push to main branch when sync.branch is configured - all
pushes should go through the sync branch worktree.
2025-12-01 20:51:54 -08:00
Steve Yegge
9483ab053e fix(sync): restore .beads/ from branch after sync when using sync.branch
When sync.branch is configured, the main branch's .beads/ directory was
showing as modified after every sync, even though the data was correctly
synced to the sync branch worktree.

This happened because:
1. Export writes to main's .beads/
2. Files are copied to worktree and committed there
3. But main's .beads/ now differs from what's committed on main

Fix: After sync completes, restore .beads/ from HEAD to keep the working
directory clean. The actual beads data lives on the sync branch; the main
branch's .beads/ is just a snapshot that should match what's committed.
2025-12-01 20:43:35 -08:00
Steve Yegge
d91f92802a fix(doctor): detect when on sync branch (bd-epn follow-up)
Add detection for when the current branch is the configured sync branch.
This is a misconfiguration that causes bd sync to fail with:

  fatal: 'beads-sync' is already used by worktree

The doctor now reports this as an error with a clear fix:
  Switch to your main working branch: git checkout main

Also shows current branch info in the OK case for better visibility.
2025-12-01 20:39:27 -08:00
Steve Yegge
94105bd9e2 feat: add bd migrate-sync command for sync.branch workflow setup (bd-epn)
Add a new command that encapsulates all the work needed to migrate a clone
to use the sync.branch workflow for multi-clone setups like Gas Town:

- Validates current state (not on sync branch, not already configured)
- Creates sync branch if it doesn't exist (from remote or locally)
- Sets up git worktree for the sync branch
- Syncs current beads data to worktree
- Commits initial state to sync branch
- Sets sync.branch configuration
- Pushes sync branch to remote

Usage:
  bd migrate-sync beads-sync           # Basic migration
  bd migrate-sync beads-sync --dry-run # Preview changes
  bd migrate-sync beads-sync --force   # Reconfigure even if set
2025-12-01 20:07:27 -08:00
Steve Yegge
f84684e314 refactor(daemon): consolidate local-only sync functions to reduce duplication (bd-73u)
Extract performExport() and performAutoImport() shared implementations:
- createExportFunc() and createLocalExportFunc() now use performExport()
  with skipGit parameter
- createAutoImportFunc() and createLocalAutoImportFunc() now use performAutoImport()
  with skipGit parameter
- createLocalSyncFunc() kept as-is (different flow from createSyncFunc)

Reduces daemon_sync.go by 89 lines (1003 -> 914) while maintaining
identical behavior and test coverage.

All existing tests pass. New shared functions use conditional logic
to skip git operations when skipGit=true, eliminating the need for
separate implementations.
2025-12-01 17:39:43 -08:00
Yaakov Nemoy
f761ba1f3a feat(daemon): add --local flag for git-free daemon operation (#433)
* feat(daemon): add --local flag for git-free operation

Add --local mode to the daemon that allows it to run without a git
repository. This decouples the daemon's core functionality (auto-flush
to JSONL, auto-import from JSONL) from git synchronization.

Changes:
- Add --local flag to daemon command
- Skip git repo check when --local is set
- Add validation that --auto-commit and --auto-push cannot be used with --local
- Create local-only sync functions that skip git operations:
  - createLocalSyncFunc: export-only for polling mode
  - createLocalExportFunc: export without git commit/push
  - createLocalAutoImportFunc: import without git pull
- Update startup message to indicate LOCAL mode
- Update event loop to use local functions when in local mode

This enables use cases like:
- Single-machine issue tracking without git
- Auto-flush to JSONL for backup purposes
- Running daemon in environments without git access

Multi-machine sync still requires git (as expected).

* fix(daemon): skip fingerprint validation in local mode

validateDatabaseFingerprint() calls beads.ComputeRepoID() which
executes git commands. This fails in non-git directories even
with --local flag.

Skip fingerprint validation entirely when running in local mode
since there's no git repository to validate against.

* test(daemon): add comprehensive test coverage for --local mode

Add tests for:
- Flag validation (--local incompatible with --auto-commit/--auto-push)
- Git check skip logic in local mode
- createLocalSyncFunc, createLocalExportFunc, createLocalAutoImportFunc
- Fingerprint validation skip in local mode
- Full integration test in non-git directory
- Export/import round-trip test

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-01 17:37:56 -08:00
Steve Yegge
34799a001d bd sync: close Jira integration epic bd-qvj 2025-12-01 10:45:11 -08:00
Steve Yegge
4a8e01f4d2 bd sync: 2025-11-30 22:11:35 2025-11-30 22:11:35 -08:00
Steve Yegge
75a2fe843b chore: update Claude plugin versions to 0.27.2 2025-11-30 21:33:16 -08:00
Steve Yegge
db144e3f1b chore: update MCP version to 0.27.2 2025-11-30 21:32:34 -08:00
Steve Yegge
5d39775f92 chore: manually update version files to 0.27.2 2025-11-30 21:31:49 -08:00
Steve Yegge
40ab349c0a bd sync: 2025-11-30 21:31:13 2025-11-30 21:31:13 -08:00
Steve Yegge
ff1d94ad41 chore: update version strings to 0.27.2 in hooks and changelog 2025-11-30 21:30:39 -08:00
Steve Yegge
a1a65e66ed chore: prepare 0.27.2 release - data corruption fix and improvements 2025-11-30 21:29:21 -08:00
Steve Yegge
8d19e75431 fix: add safety guard to prevent git-history-backfill mass deletion (bd-t5m)
When a clone gets reset (git reset --hard origin/main), the
git-history-backfill logic was incorrectly marking ALL issues as
deleted since they appeared in git history but not in the current
JSONL. This caused the entire database to be purged.

Fix:
- Add 50% threshold check: abort if git-history-backfill would delete
  more than 50% of issues (likely a reset scenario, not deletions)
- Add warning when >10 issues would be deleted via backfill
- Print helpful message about manual deletion if needed

Test:
- Added TestMassDeletionSafetyGuard that simulates JSONL reset and
  verifies the safety guard prevents mass deletion

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 21:26:16 -08:00
Steve Yegge
da38f8becf bd sync: close bd-4zy (import deletions warning) 2025-11-30 21:23:22 -08:00
Steve Yegge
f7dea354d8 fix(import): add warning when issues are skipped due to deletions manifest
When importing JSONL that contains issues in the deletions manifest,
import now:
- Filters out deleted issues before import
- Prints per-issue warning with deletion details (date, actor)
- Shows count of skipped issues in summary
- Suggests --ignore-deletions flag to force import

The new --ignore-deletions flag allows importing issues that are in the
deletions manifest, useful for recovering accidentally deleted issues.

Fixes bd-4zy

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 21:23:04 -08:00
Steve Yegge
3df138445a fix(init): allow fresh clones with JSONL to run bd init (bd-4h9)
Previously, bd init blocked when JSONL existed with issues but no database,
telling users to run 'bd doctor --fix'. But doctor --fix just ran bd migrate
which requires an existing database - creating a circular dependency.

Now:
- bd init allows fresh clones (JSONL exists, no database) to proceed
- bd init creates the database and imports from JSONL automatically
- bd doctor --fix runs bd init (not migrate) when there's no database

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 21:18:23 -08:00
Steve Yegge
d3dafcf76e bd sync: update beads files 2025-11-30 21:14:10 -08:00
Steve Yegge
e4de6f8af4 bd sync: 2025-11-30 21:13:33 2025-11-30 21:13:33 -08:00
Steve Yegge
5413536d5c bd sync: 2025-11-30 20:59:33 2025-11-30 20:59:33 -08:00
Steve Yegge
4616b20127 bd sync: 2025-11-30 20:51:02 2025-11-30 20:51:02 -08:00
Steve Yegge
2320a1c2ef fix: ExtractIssuePrefix now handles 3-char base36 hashes (#425)
- Lower minimum hash length from 4 to 3 characters
- Update hash validation to support base36 (0-9, a-z) instead of just hex
- Require at least one digit to distinguish hashes from English words
- Fixes prefix extraction for hyphenated prefixes with 3-char hashes
  e.g., 'document-intelligence-0sa' now correctly extracts 'document-intelligence'
- Add test cases for 3-char hashes with multi-part prefixes
- Resolves bd sync failures with 'prefix mismatch detected' errors
2025-11-30 20:50:56 -08:00
Steve Yegge
af78e7b10c bd sync: 2025-11-30 20:37:45 2025-11-30 20:37:45 -08:00
Steve Yegge
0b914d545a bd sync: update issues.jsonl 2025-11-30 19:24:31 -08:00
Steve Yegge
8a6fd9c0ff feat: add .beads/redirect file support for workspace redirection
Adds a lightweight redirect mechanism that allows a stub .beads directory
to point to the actual beads location. This solves the workspace problem
where an AI agent runs in one directory but needs to operate on beads
stored elsewhere.

The redirect file is a simple text file containing a path (relative or
absolute) to the target .beads directory. Comments (lines starting with #)
are supported. Redirect chains are prevented - only one level is followed.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 19:23:30 -08:00
Steve Yegge
3deed3606d Merge pull request #435 from jzillmann/fix/wal-checkpoint-on-close
fix: checkpoint WAL on Close() to persist writes
2025-11-30 17:19:12 -08:00
Steve Yegge
e6ddacf0be bd sync: 2025-11-30 17:18:21 2025-11-30 17:18:21 -08:00
Steve Yegge
e452a60627 bd sync: 2025-11-30 17:17:57 2025-11-30 17:18:08 -08:00
Steve Yegge
534772cf3c test: add unit tests for Jira integration
- Test isJiraExternalRef helper with various URL patterns
- Test stats struct initialization
- Test result struct fields

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 15:35:30 -08:00