Commit Graph

3276 Commits

Author SHA1 Message Date
Steve Yegge
22e63fb128 Merge GH#402 2025-12-16 01:18:59 -08:00
Steve Yegge
109fa6364b Merge GH#518 setup docs 2025-12-16 01:18:51 -08:00
Steve Yegge
c4e122a888 Merge bd-dvw8-rictus: GH#505 reset 2025-12-16 01:18:38 -08:00
Steve Yegge
5bceda10a4 chore: sync beads 2025-12-16 01:18:33 -08:00
Steve Yegge
8306b2b8f3 Merge bd-2k5f-pumpjack: GH#483 2025-12-16 01:18:02 -08:00
Steve Yegge
3be20d64da chore: sync beads 2025-12-16 01:17:54 -08:00
Steve Yegge
3baf4ae50a Merge bd-7r4l-prospector: GH#540 2025-12-16 01:17:25 -08:00
Steve Yegge
72441eea49 Merge bd-cddj-nux: GH#519 2025-12-16 01:17:25 -08:00
Steve Yegge
2e9b5a5870 Merge bd-xoyh-morsov: GH#517 2025-12-16 01:17:18 -08:00
Steve Yegge
60ae6586e7 Merge bd-zbyb-gusher: GH#509 worktrees 2025-12-16 01:16:46 -08:00
Steve Yegge
2d1c8900cb chore: sync beads 2025-12-16 01:16:40 -08:00
Steve Yegge
a518581a86 Merge bd-6xfz-furiosa: GH#405 prefix parsing 2025-12-16 01:16:26 -08:00
Steve Yegge
b3fef08fd4 Merge bd-bscs-driller: GH#403 doctor --fix 2025-12-16 01:15:51 -08:00
Steve Yegge
40c6893f33 Merge bd-er7r-derrick: GH#444 status naming 2025-12-16 01:15:36 -08:00
Steve Yegge
11c3bb4fdb Merge bd-0yzm-ace: GH#522 --type flag for bd update 2025-12-16 01:15:11 -08:00
Steve Yegge
3d8750883c chore: track and close GH#405 fix 2025-12-16 01:14:03 -08:00
Steve Yegge
e3b6091931 feat(sync): add --check flag for pre-sync integrity checks (bd-hlsw.1)
Add bd sync --check command that performs pre-sync integrity checks
without modifying state:

1. Force push detection: Detects when sync branch has diverged from
   remote, indicating a potential force push

2. Prefix mismatch detection: Scans JSONL for issues that don't match
   the configured prefix

3. Orphaned children detection: Finds issues with parent references
   to non-existent issues

Outputs diagnostic with actionable suggestions for each problem found.
Exits with code 1 if any problems are detected.

Implements bd-hlsw.1: Pre-sync integrity check
2025-12-16 01:13:23 -08:00
Steve Yegge
77aeb50d27 fix(utils): parse multi-hyphen prefixes correctly (GH#405)
The ExtractIssuePrefix function was falling back to first-hyphen
extraction when the suffix didn't look like a hash (e.g., 4+ char
words without digits). This broke prefixes like 'hacker-news' where
an issue ID 'hacker-news-test' would incorrectly extract 'hacker'.

Fix: Always use last-hyphen extraction for alphanumeric suffixes.
Only fall back to first-hyphen for non-alphanumeric suffixes.

Examples:
- 'hacker-news-test' -> 'hacker-news' (was: 'hacker')
- 'me-py-toolkit-abc' -> 'me-py-toolkit' (was: 'me')
- 'vc-baseline-hello' -> 'vc-baseline' (was: 'vc')

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:13:15 -08:00
Steve Yegge
9458922f26 chore: close GH#509 - already fixed by PR #478 2025-12-16 01:10:10 -08:00
Steve Yegge
69ac8fdbc2 chore: close bd-l0pg (duplicate GH#483) 2025-12-16 01:10:02 -08:00
Steve Yegge
5d6c9aea2e chore: close bd-2rfr after implementing bd reset 2025-12-16 01:09:53 -08:00
Steve Yegge
25b3876113 chore: sync beads - close GH#522 2025-12-16 01:09:28 -08:00
Steve Yegge
91bce49d47 feat: add bd reset command for complete beads removal (GH#505)
Adds a new `bd reset` command that completely removes beads from a
repository, automating the manual uninstall process.

The command:
1. Stops any running daemon
2. Removes git hooks installed by beads
3. Removes the merge driver configuration
4. Removes beads entry from .gitattributes
5. Deletes the .beads directory (ALL ISSUE DATA)
6. Removes the sync worktree (if exists)

Safety features:
- Requires --confirm <remote> to prevent accidental data loss
- Supports --dry-run to preview what would be removed
- Provides clear warnings about permanent data deletion

Closes GH#505

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:09:23 -08:00
Steve Yegge
53ccbfa217 fix: bd sync works when on sync branch (GH#519)
When sync.branch is set to the current branch (e.g., main), bd sync
now commits directly instead of failing with a worktree error.

Changes:
- sync.go: Detect when current branch == sync branch and skip worktree
- sync.go: Show appropriate messages for direct-mode commits/pulls
- doctor.go: Change from Error to OK status when on sync branch

The fix allows users to work directly on the sync branch without
having to switch to a different branch for bd sync to work.

Closes: GH#519

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:09:22 -08:00
Steve Yegge
57cb73dc89 chore: close bd-zci3 (GH#540 silent quick-capture) 2025-12-16 01:09:19 -08:00
Steve Yegge
1016559ad7 chore: close bd-boh7 (GH#403 fix) 2025-12-16 01:09:08 -08:00
Steve Yegge
39a58fd085 docs: document bd setup command
Add comprehensive documentation for the bd setup command which was
largely undocumented (GH#518):

- CLI_REFERENCE.md: Add new "Editor Integration" section documenting
  bd setup claude/cursor/aider commands with all flags
- INSTALLING.md: Fix incorrect reference to "bd hooks install" for
  editor integration - should be "bd setup <editor>"
- CLAUDE_INTEGRATION.md: Add Installation section with bd setup claude
  examples

Fixes: GH#518

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:08:42 -08:00
Steve Yegge
cd8320fe3e feat: add silent quick-capture mode (bd q)
Add a truly silent quick-capture command that outputs only the issue ID,
enabling seamless script integration and reducing noise in AI conversations.

Changes:
- Add --silent flag to 'bd create' command
- Create new 'bd q' alias for quick capture
- Suppress warnings in silent/quiet mode

Usage:
  bd q "Fix login bug"           # Outputs only: bd-a1b2
  ISSUE=$(bd q "New feature")    # Capture ID in variable
  bd create "Task" --silent       # Same as bd q

Closes #540

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:08:40 -08:00
Steve Yegge
eac8ecc667 fix(doctor): remove circular error message in --fix mode
When `bd doctor --fix` fails to apply a fix, it was showing
"Manual fix: Run 'bd doctor --fix' ..." which is circular and unhelpful.

Now extracts just the manual command from the fix message:
- "..., or manually: <cmd>" -> extracts <cmd>
- "bd doctor --fix or <alt>" -> extracts <alt>
- No alternative available -> shows nothing

Closes GH#403

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:08:20 -08:00
Steve Yegge
00cd799fc3 chore: close bd-forz (GH#444 fix) 2025-12-16 01:08:11 -08:00
Steve Yegge
7d35ced5ae feat(update): add --type flag to bd update command (GH#522)
Allow changing an issue type (bug, feature, task, epic, chore) via the
bd update command. The storage layer already supported issue_type in
allowedUpdateFields, this just exposes it through the CLI.

Changes:
- Add --type/-t flag to updateCmd in show.go
- Add IssueType field to UpdateArgs in protocol.go
- Handle issue_type in updatesFromArgs in server_issues_epics.go
- Add validation using ParseIssueType before update

Example usage:
  bd update ab-xyz --type epic

Fixes: #522
2025-12-16 01:08:11 -08:00
Steve Yegge
a99441a84d chore: close bd-aqkh (GH#402 already fixed) 2025-12-16 01:08:10 -08:00
Steve Yegge
c4e30c0f0c chore: close bd-drmg (GH#483 fix) 2025-12-16 01:08:04 -08:00
Steve Yegge
0c9e78f42e fix: improve priority format documentation and error message (GH#517)
Claude was using word-based priorities like "medium" instead of numeric
values (0-4 or P0-P4), causing bd create commands to fail in a loop.

Changes:
- Update bd prime output to clearly document priority format with example
- Add explicit note: NOT "high"/"medium"/"low"
- Improve error message to mention that words are not valid

Closes #517

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:07:55 -08:00
Steve Yegge
3c58e0aa25 fix(hooks): pre-commit no longer blocks when .beads removed (GH#483)
Two fixes to make pre-commit hook more resilient:

1. Check if beads is actually initialized (has db, config, or jsonl)
   - Empty .beads directory no longer triggers sync attempt
   - Handles case where .beads was removed from git but dir lingers

2. Make sync failure a warning instead of blocking error
   - Beads issues shouldn't prevent code commits
   - User can still run 'bd sync --flush-only' manually

Also synced examples/git-hooks/pre-commit with template (worktree handling).

Closes #483

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:07:48 -08:00
Steve Yegge
de75e5181c feat(sync): improve divergence recovery UX (bd-vckm)
When sync branch diverges significantly from remote, provide clear
recovery options instead of a confusing rebase conflict error.

- Add CheckDivergence() to detect and report sync branch divergence
- Add ResetToRemote() to reset local sync branch to remote state
- Add --reset-remote and --force-push flags for recovery
- Improve error message when rebase fails to include recovery steps

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:07:34 -08:00
Steve Yegge
4bf369a618 fix(docs): use consistent in_progress status naming (GH#444)
Changed all user-facing documentation and help text to use `in_progress`
(underscore) instead of `in-progress` (hyphen) to match the canonical
status value.

Files updated:
- cmd/bd/ready.go - Short description
- cmd/bd/status.go - Long description
- commands/stats.md - Action suggestion
- README.md - Workflow description

Note: CSS class names, HTML IDs, and GitHub label mappings intentionally
kept with hyphens as they follow different conventions.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:07:33 -08:00
Steve Yegge
39e09449cc fix: orphan detection false positive with dots in directory name
Only treat issue IDs as hierarchical (parent.child) when the dot appears
AFTER the first hyphen. This prevents false positives when the project
directory name contains a dot (e.g., "my.project-abc123" was incorrectly
being treated as having parent "my").

Fixes GH#508

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:06:14 -08:00
Steve Yegge
2c86404d65 fix: resolve P2 sync noise and cleanup issues
- bd-6pni: Auto-filter tombstoned issues with mismatched prefixes during
  import instead of failing. Tombstones from contributor PRs with different
  test prefixes are pollution and safe to ignore.

- bd-ffr9: Stop recreating deletions.jsonl after tombstone migration.
  Added IsTombstoneMigrationComplete() check to all code paths that write
  to the legacy deletions manifest.

- bd-admx: Fix perpetual "JSONL file hash mismatch" warning. Now clears
  both export_hashes AND jsonl_file_hash when mismatch detected, so the
  warning doesn't repeat.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 00:56:06 -08:00
Steve Yegge
88ccce884c chore: update Go toolchain to 1.24.11 to address CVEs
Fixes #565. Updates toolchain from go1.24.2 to go1.24.11 to address:
- CVE-2025-22874: crypto/x509 ExtKeyUsageAny policy validation
- CVE-2025-47907: database/sql Postgres Scan race condition
- CVE-2025-58183: archive/tar unbounded allocation
- CVE-2025-58186: net/http unbounded headers
- CVE-2025-58187: crypto/x509 name constraint resource consumption
- CVE-2025-61729: crypto/x509 excessive resource consumption

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 00:52:54 -08:00
Steve Yegge
25ea1e7de3 docs: fix broken relative links across documentation
Fixes 46 broken relative links across 20 documentation files in docs/.

Changes:
- Added ../ prefix for root files (README.md, AGENTS.md)
- Removed ../ prefix for sibling docs files
- Removed dead links to non-existent files
- Fixed subdirectory paths

Based on PR #574 by chrisvaillancourt.

Co-Authored-By: Chris Vaillancourt <chrisvaillancourt@users.noreply.github.com>
2025-12-16 00:46:08 -08:00
Steve Yegge
8c45069228 fix(doctor,sync): clean up deletions manifest and reduce sync noise
- bd-8v5o: When doctor --fix hydrates issues from git history, also
  remove them from the deletions manifest to prevent perpetual skip
  warnings during sync

- bd-wsqt: Remove verbose per-issue "Skipping bd-xxx" messages during
  sync. Caller already shows summary of skipped issues.

Added RemoveDeletions() function to deletions package with tests.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 00:42:36 -08:00
Steve Yegge
171f7de250 Merge pull request #584 from rsnodgrass/repair-hashes
fix(rename-prefix): use hash IDs instead of sequential in --repair mode
2025-12-16 00:42:32 -08:00
Steve Yegge
4657ec7640 Merge pull request #569 from crcatala/feature/daemon-status-config
feat(daemon): show configuration in `bd daemon --status` output
2025-12-16 00:35:07 -08:00
Steve Yegge
07fc9bf094 Merge pull request #564 from deblasis/fix-daemon-stale-cache
fix(daemon): detect external db file replacement
2025-12-16 00:34:57 -08:00
Ryan Snodgrass
627ac1afb8 fix(import): skip cross-prefix content matches instead of triggering rename
When importing issues, if an incoming issue has the same content hash as an
existing issue but a DIFFERENT prefix, this should not be treated as a rename.
Cross-prefix content matches occur when importing issues from other projects
that happen to have identical content.

Previously, the importer would call handleRename which tries to create an issue
with the incoming prefix, failing prefix validation ("does not match configured
prefix" error).

The fix checks if prefixes differ before calling handleRename:
- Same prefix, different ID suffix → true rename, call handleRename
- Different prefix → skip incoming issue, keep existing unchanged

Added test: TestImportCrossPrefixContentMatch reproduces the bug scenario
where alpha-* issues exist but beta-* issues are imported with same content.
2025-12-16 00:29:19 -08:00
Ryan Snodgrass
421d41dfa0 docs: add detailed comments explaining ID formats and merge deletion logic
Document the intent and nuances of recent fixes:

internal/importer/utils.go:
- RenameImportedIssuePrefixes: explain the three ID formats (sequential,
  hash-based, hierarchical) and how prefix renaming preserves identity
- isValidIDSuffix: document why dots are allowed (hierarchical parent-child
  relationships) and what characters are rejected

cmd/bd/deletion_tracking.go:
- isIssueNotFoundError: explain why "not found" is success during merge
  (issue may be tombstoned, never existed locally, or manually deleted)
- Deletion loop: document what "accepted deletions" means and why we
  tolerate missing issues during the pruning phase
2025-12-16 00:17:40 -08:00
Ryan Snodgrass
e3d8119f8e fix(sync): tolerate "issue not found" during 3-way merge deletion
During sync, the 3-way merge logic tries to delete issues that were
removed remotely. If an issue is already gone (tombstoned or never
existed locally), that shouldn't be an error - the goal is just to
ensure the issue is deleted.

Changes:
- Add isIssueNotFoundError helper to detect missing issue errors
- Skip "issue not found" errors during merge deletion (count as success)
- Update stats output to show already-gone count when relevant
2025-12-16 00:15:35 -08:00
Brennon Bortz
68135806c6 feat(show): Display status for all dependent issues (#583)
Update bd show command to include status information for all dependency
types (children, blocks, related, discovered). Issues now display with
format [P1 - closed] instead of just [P1].

This provides better visibility into the state of dependent issues
without needing to run bd show on each individual issue.

Changes:
- Updated daemon mode formatting for all dependency types (lines 208, 214, 220, 226)
- Updated direct mode formatting for all dependency types (lines 400, 406, 412, 418)
- Changed format from "[P%d]" to "[P%d - %s]" with dash separator

Example output:
Children (9):
  ↳ pma-an8: Create config.py module [P1 - closed]
  ↳ pma-38g: Create utils.py module [P1 - open]

Blocks (1):
  ← pma-uzm: Adapt validate_outputs.py [P1 - blocked]

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-16 00:13:51 -08:00
Ryan Snodgrass
c7b45a8a40 fix(import): support hierarchical hash IDs in --rename-on-import
The isNumeric function was rejecting valid hierarchical hash IDs like
'6we.2' that contain dots for parent.child notation. This caused
`bd import --rename-on-import` to fail with "non-numeric suffix" errors.

Changes:
- Rename isNumeric to isValidIDSuffix for clarity
- Accept dots (.) in addition to alphanumeric for hierarchical IDs
- Update test cases to cover hierarchical ID formats
2025-12-16 00:12:10 -08:00