Commit Graph

4662 Commits

Author SHA1 Message Date
Andrey Taranov
1a64654c48 fix(sync): force-add .beads in worktree for contributor mode (#947)
In contributor mode (bd init --contributor), .beads/ is excluded in
.git/info/exclude to prevent committing upstream issue databases.
However, this exclusion applies to ALL worktrees, including the sync
worktree where .beads/ must be committed.

The fix adds -f flag to git add in commitInWorktree() to force-add
files even when gitignored. This follows the existing pattern in
beads where -f is used for worktree operations (git worktree add -f).

Fixes: bd sync failing with "git add failed in worktree: exit status 1"

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

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 17:40:09 -08:00
beads/crew/emma
744d2a7d22 feat(create): add --dry-run flag to preview issue creation (bd-0hi7)
Adds --dry-run flag that shows what would be created without actually
creating the issue. Useful for scripting and validation.

- Shows preview in human-readable format by default
- Outputs full issue JSON with --json flag (empty ID, not placeholder string)
- Skips all side effects (hooks, labels, dependencies)
- Works with --rig/--prefix flags (shows target rig)
- Errors gracefully with --file flag (not supported)
- Includes event fields when --type=event
2026-01-07 01:08:28 -08:00
beads/crew/emma
81a2af9598 Revert "fix(formula): add dev path to local-install and clarify bump-version.sh (bd-z8xz)"
This reverts commit fd3e78461231301193c08f960b73e8d0ec1d531a.
2026-01-07 00:46:48 -08:00
beads/crew/emma
b391a96465 fix(formula): add dev path to local-install and clarify bump-version.sh (bd-z8xz)
- Add Option 3 to local-install step: build from source with macOS codesigning
- Clarify run-bump-script step: bump-version.sh is the authority for release mechanics
- Document --all flag includes --install --mcp-local --restart-daemons
- Add reference to ./scripts/bump-version.sh --help
2026-01-07 00:46:48 -08:00
beads/crew/emma
ee5bc5931a feat(gate): auto-discover workflow run ID in gate check (bd-fbkd)
When bd gate check encounters a gh:run gate with a non-numeric await_id
(workflow name hint like release.yml), it now auto-discovers the run ID:

- Queries GitHub directly with gh run list --workflow=X
- Takes the most recent run (deterministic: newest-first from API)
- Updates the gates await_id and proceeds with status check

This is ZFC-compliant: most recent run of workflow X is purely mechanical,
no heuristic scoring. Agents no longer need to run bd gate discover manually.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 00:36:51 -08:00
beads/crew/emma
812f4e5297 chore: Bump version to 0.46.0
Updated all component versions:
- bd CLI: 0.45.0 → 0.46.0
- Plugin: 0.45.0 → 0.46.0
- MCP server: 0.45.0 → 0.46.0
- npm package: 0.45.0 → 0.46.0
- Documentation: 0.45.0 → 0.46.0

Changes in 0.46.0:
- Custom type support in beads config.yaml (bd-649s)
- Gas Town types extraction into beads core (bd-i54l)
- Gate workflow discovery improvements (bd-m8ew)
2026-01-06 23:51:29 -08:00
dave
4440f9e8cb refactor(gate): consolidate numeric ID check and improve workflow matching
Code review improvements:
- Make isNumericRunID delegate to isNumericID (DRY)
- Extract workflowNameMatches() for clearer, more robust matching
- Handle hint→filename matching (e.g., "release" matches "release.yml")
- Add TestWorkflowNameMatches with comprehensive test cases

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-06 23:40:37 -08:00
dave
8528fcaa4e fix(gate): handle workflow name hints in gh:run gate discovery (bd-m8ew)
When a formula specifies a gate with id="release.yml", the AwaitID
now properly functions as a workflow name hint:

- gate discover: finds gates where AwaitID is empty OR non-numeric
- gate discover: filters matching runs by workflow name when hint present
- gate check: gracefully handles non-numeric AwaitID with clear message

Added isNumericRunID/isNumericID helpers and tests for the new behavior.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-06 23:34:30 -08:00
fang
90c5be3a13 test: update version threshold in TestCheckMetadataVersionTracking
The test for "slightly outdated version" was using 0.35.0, which is now
10 minor versions behind the current 0.45.0. This exceeds the threshold
for "very old" (>=10 minor versions), causing the test to fail.

Updated the test version from 0.35.0 to 0.43.0 to stay within the
"slightly outdated" range (2 minor versions behind).

(bd-iw11)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 23:31:09 -08:00
dave
a70c3a8cbe feat: extract Gas Town types from beads core (bd-i54l)
Remove Gas Town-specific issue types (agent, role, rig, convoy, slot)
from beads core. These types are now identified by labels instead:
- gt:agent, gt:role, gt:rig, gt:convoy, gt:slot

Changes:
- internal/types/types.go: Remove TypeAgent, TypeRole, TypeRig, TypeConvoy, TypeSlot constants
- cmd/bd/agent.go: Create agents with TypeTask + gt:agent label
- cmd/bd/merge_slot.go: Create slots with TypeTask + gt:slot label
- internal/storage/sqlite/queries.go, transaction.go: Query convoys by gt:convoy label
- internal/rpc/server_issues_epics.go: Check gt:agent label for role_type/rig label auto-add
- cmd/bd/create.go: Check gt:agent label for role_type/rig label auto-add
- internal/ui/styles.go: Remove agent/role/rig type colors
- cmd/bd/export_obsidian.go: Remove agent/role/rig/convoy type tag mappings
- Update all affected tests

This enables beads to be a generic issue tracker while Gas Town
uses labels for its specific type semantics.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-06 22:18:37 -08:00
beads/crew/dave
b7358f17bf feat(types): add custom type support to beads config (bd-649s)
Add types.custom config key mirroring the status.custom pattern:
- Add CustomTypeConfigKey constant and GetCustomTypes() to storage interface
- Add IssueType.IsValidWithCustom() method for validation
- Add ValidateWithCustom() to Issue for combined status/type validation
- Update all validation call sites to use GetCustomTypes()
- Rename parseCustomStatuses to parseCommaSeparated for reuse

This enables Gas Town to register custom types like agent/role/rig/convoy
without hardcoding them in beads core, supporting the type extraction epic.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-06 21:30:58 -08:00
beads/crew/dave
3287340678 chore: Bump version to 0.45.0
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-06 20:11:48 -08:00
beads/crew/giles
d02bde04ad fix(lint): handle Close error in completions.go 2026-01-06 19:37:20 -08:00
beads/crew/giles
8c2810e905 fix(ci): restore Windows smoke tests instead of full test suite
PR #904 incorrectly changed Windows from smoke tests to full `go test ./...`
which times out (see bd-bmev). Windows full tests take 20+ minutes vs ~1min
for smoke tests.

Restore the original approach:
- Linux/macOS: full test suite with `go test ./...`
- Windows: smoke tests only (build + basic CRUD commands)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 19:34:34 -08:00
beads/crew/wolf
6ce36ab1f3 fix(lint): address G304 and unparam warnings
- Add #nosec G304 comment to parseJSONLFile in rename_prefix.go
- Mark unused noGitHistory param in importFromJSONLInline (mirrors import.go pattern)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 19:32:20 -08:00
Peter Chanthamynavong
520518c68b refactor(test): replace testify with stdlib in daemon tests (#936)
The daemon socket tests relied on an external assertion library, which
increased the module's dependency footprint and deviated from Go's
idiomatic testing patterns.

This commit introduces a leaner testing approach using the standard
library:
- Replace testify/assert calls with standard if checks and t.Errorf
- Remove testify and associated indirects from go.mod

These changes preserve existing test behavior while simplifying the
build process and reducing external maintenance overhead.
2026-01-06 19:29:57 -08:00
Steve Yegge
6c287074dc Merge pull request #926 from JeremyKalmus/patch-1
Add Parade app to community tools list
2026-01-06 19:27:53 -08:00
Peter Chanthamynavong
12858f5146 fix(doctor): recognize lowercase 's' skip-worktree flag (#931)
* fix(doctor): handle 's' status in combined git flags

Problem:
- Git status detection failed when 's' was combined with other flags
- Branch synchronization checks produced incorrect results due to missing flag parsing

Solution:
- Update detection logic to correctly identify the 's' status within combined flag strings

Impact:
- Ensures branch synchronization state is accurately reported during doctor checks

* test(doctor): add unit tests for git flag parsing

- Extract git flag parsing logic into parseGitLsFilesFlag helper
- Add unit tests for git flag parsing logic

Coverage: Git flag parsing in sync_branch.go
2026-01-06 19:22:51 -08:00
Steve Yegge
65f484d809 Merge pull request #934 from peterkc/fix/init-branch-persistence
fix(init): persist --branch flag to config.yaml
2026-01-06 19:22:22 -08:00
beads/crew/giles
8bf9410d39 fix(lint): add rename_prefix.go to G304 exclusions
The parseJSONLFile function reads user-specified JSONL files
which is safe for this context.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 19:15:27 -08:00
Yaroslav Lapin
4eb2856143 Add bun installation method to INSTALLING.md (#930) 2026-01-06 19:14:38 -08:00
Peter Chanthamynavong
e9e0d7f1e5 feat(daemon): add BD_SOCKET env var for test isolation (#914)
Add BD_SOCKET environment variable support to override daemon socket path,
enabling parallel test isolation via t.TempDir() + t.Setenv().

Changes:
- getSocketPath() checks BD_SOCKET first, falls back to dbPath-derived path
- getSocketPathForPID() checks BD_SOCKET first (for consistency)
- Add daemon_socket_test.go with isolation pattern examples

This is a minimal tracer bullet to validate the approach before
expanding to full test isolation infrastructure.

Backward compatible: default behavior unchanged without env var set.
2026-01-06 19:13:49 -08:00
beads/crew/dave
5dfb838d60 feat(completion): optimize ID prefix filtering and add completions to more commands
Improvements to shell completions from PR #935:

1. Add IDPrefix field to IssueFilter for efficient database-level filtering
   - Queries are now filtered at SQL level instead of fetching all issues
   - Updated sqlite, transaction, and memory stores to support IDPrefix

2. Add ValidArgsFunction to additional commands:
   - dep (add, remove, list, tree)
   - comments, comment (add)
   - delete
   - graph
   - label (add, remove, list)
   - duplicate, supersede
   - audit
   - move
   - relate, unrelate
   - refile
   - gate (show, resolve, add-waiter)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-06 19:05:34 -08:00
Bob Cotton
025cdac962 feat(completion): add dynamic shell completions for issue IDs (#935)
Add intelligent shell completions that query the database to provide
issue ID suggestions with titles for commands that take IDs as arguments.

Changes:
- Add issueIDCompletion function that queries storage for all issues
- Register completion for show, update, close, edit, defer, undefer, reopen
- Add comprehensive test suite with 3 test cases
- Completions display ID with title as description (ID\tTitle format)

The completion function opens the database (read-only) and filters issues
based on the partially typed prefix, providing a better UX for commands
that require issue IDs.

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

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 18:59:25 -08:00
furiosa
bf378650f4 feat(types): add rig identity bead type (gt-zmznh)
- Add TypeRig constant to IssueType enum
- Update IsValid() method to include TypeRig
- Add UI color (orange) and style for rig type
- Update CLI flag descriptions in create and update commands
- Add Obsidian export tag for rig type
- Add comprehensive test cases for rig and other newer types

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 18:55:45 -08:00
beads/crew/wolf
94997bd619 fix(sync): use inline import for --import-only with redirect (bd-ysal)
When running `bd sync --import-only` from a directory with `.beads/redirect`,
the subprocess-based import could fail to update staleness metadata correctly
because the subprocess might resolve paths differently than the parent process.

The fix uses inline import (calling importIssuesCore directly) instead of
spawning a subprocess. This ensures:
1. The same store and dbPath are used throughout
2. Path resolution is consistent with the parent process
3. Staleness metadata is updated correctly in the redirected database

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 18:51:38 -08:00
aaron-sangster
cca2016376 fix(worktree): resolve worktrees by name from git registry (#921) 2026-01-06 18:45:27 -08:00
Peter Chanthamynavong
362b07d74f fix(init): ensure sync branch persistence on init
Problem:
- Sync branch setup occurred before the config file was initialized
- Persistence only targeted the database, leading to loss on re-init

Solution:
- Reorder initialization to create the config file before sync setup
- Synchronize sync branch state to both config file and database

Impact:
- Settings are preserved across re-initialization and DB clears
- Better consistency between file and database state

Fixes: #927 (Bug 3)
2026-01-06 15:22:15 -08:00
Peter Chanthamynavong
c1d3644b9a test(init): verify --branch flag persistence
- Add test case for --branch flag persistence in config.yaml

Coverage: init command configuration logic
2026-01-06 14:59:51 -08:00
beads/crew/giles
c43682f5b6 fix(ci): update golangci-lint exclusions and increase Windows timeout
- Add daemon_autostart.go, doctor/fix/sync_branch.go to G304 exclusions
- Add setup.go to G306 exclusions (config files need 0644)
- Add gate.go, gate_discover.go to G204 exclusions (gh/gt CLI calls)
- Add misspell exclusion for "cancelled" in gate.go (matches GitHub API)
- Increase Windows test timeout to 30m (was timing out at 20m)

These exclusions complement the #nosec annotations already in the code.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 13:24:04 -08:00
beads/crew/giles
2fb6fd074a fix(ci): address Windows test failures and timeout
- Extract inode function to platform-specific files (inode_unix.go,
  inode_windows.go) to fix syscall.Stat_t compile error on Windows
- Add skipOnWindows helper and skip Unix permission/symlink tests
  on Windows where chmod semantics differ
- Increase Windows test timeout from 10m to 20m since full test
  suite runs slower without race detector

Fixes Windows CI failures introduced when PR #904 expanded Windows
testing from smoke tests to full test suite.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 12:59:26 -08:00
Ryan
ffe0dca2a3 feat(daemon): unify auto-sync config for simpler agent workflows (#904)
* feat(daemon): unify auto-sync config for simpler agent workflows

## Problem

Agents running `bd sync` at session end caused delays in the Claude Code
"event loop", slowing development. The daemon was already auto-exporting
DB→JSONL instantly, but auto-commit and auto-push weren't enabled by
default when sync-branch was configured - requiring manual `bd sync`.

Additionally, having three separate config options (auto-commit, auto-push,
auto-pull) was confusing and could get out of sync.

## Solution

Simplify to two intuitive sync modes:

1. **Read/Write Mode** (`daemon.auto-sync: true` or `BEADS_AUTO_SYNC=true`)
   - Enables auto-commit + auto-push + auto-pull
   - Full bidirectional sync - eliminates need for manual `bd sync`
   - Default when sync-branch is configured

2. **Read-Only Mode** (`daemon.auto-pull: true` or `BEADS_AUTO_PULL=true`)
   - Only receives updates from team
   - Does NOT auto-publish changes
   - Useful for experimental work or manual review before sharing

## Benefits

- **Faster agent workflows**: No more `bd sync` delays at session end
- **Simpler config**: Two modes instead of three separate toggles
- **Backward compatible**: Legacy auto_commit/auto_push settings still work
  (treated as auto-sync=true)
- **Adaptive `bd prime`**: Session close protocol adapts when daemon is
  auto-syncing (shows simplified 4-step git workflow, no `bd sync`)
- **Doctor warnings**: `bd doctor` warns about deprecated legacy config

## Changes

- cmd/bd/daemon.go: Add loadDaemonAutoSettings() with unified config logic
- cmd/bd/doctor.go: Add CheckLegacyDaemonConfig call
- cmd/bd/doctor/daemon.go: Add CheckDaemonAutoSync, CheckLegacyDaemonConfig
- cmd/bd/init_team.go: Use daemon.auto-sync in team wizard
- cmd/bd/prime.go: Detect daemon auto-sync, adapt session close protocol
- cmd/bd/prime_test.go: Add stubIsDaemonAutoSyncing for testing

* docs: add comprehensive daemon technical analysis

Add daemon-summary.md documenting the beads daemon architecture,
memory analysis (explaining the 30-35MB footprint), platform support
comparison, historical problems and fixes, and architectural guidance
for other projects implementing similar daemon patterns.

Key sections:
- Architecture deep dive with component diagrams
- Memory breakdown (SQLite WASM runtime is the main contributor)
- Platform support matrix (macOS/Linux full, Windows partial)
- Historical bugs and their fixes with reusable patterns
- Analysis of daemon usefulness without database (verdict: low value)
- Expert-reviewed improvement proposals (3 recommended, 3 skipped)
- Technical design patterns for other implementations

* feat: add cross-platform CI matrix and dual-mode test framework

Cross-Platform CI:
- Add Windows, macOS, Linux matrix to catch platform-specific bugs
- Linux: full tests with race detector and coverage
- macOS: full tests with race detector
- Windows: full tests without race detector (performance)
- Catches bugs like GH#880 (macOS path casing) and GH#387 (Windows daemon)

Dual-Mode Test Framework (cmd/bd/dual_mode_test.go):
- Runs tests in both direct mode and daemon mode
- Prevents recurring bug pattern (GH#719, GH#751, bd-fu83)
- Provides DualModeTestEnv with helper methods for common operations
- Includes 5 example tests demonstrating the pattern

Documentation:
- Add dual-mode testing section to CONTRIBUTING.md
- Document RunDualModeTest API and available helpers

Test Fixes:
- Fix sync_local_only_test.go gitPull/gitPush calls
- Add gate_no_daemon_test.go for beads-70c4 investigation

* fix(test): isolate TestFindBeadsDir tests with BEADS_DIR env var

The tests were finding the real project's .beads directory instead of
the temp directory because FindBeadsDir() walks up the directory tree.
Using BEADS_DIR env var provides proper test isolation.

* fix(test): stop daemon before running test suite guard

The test suite guard checks that tests don't modify the real repo's .beads
directory. However, a background daemon running auto-sync would touch
issues.jsonl during test execution, causing false positives.

Changes:
- Set BEADS_NO_DAEMON=1 to prevent daemon auto-start from tests
- Stop any running daemon for the repo before taking the "before" snapshot
- Uses exec to call `bd daemon --stop` to avoid import cycle issues

* chore: revert .beads/issues.jsonl to upstream/main

Per CONTRIBUTING.md, .beads/issues.jsonl should not be modified in PRs.
2026-01-06 12:52:19 -08:00
JeremyKalmus
91e7054f3c Add Parade app to community tools list 2026-01-06 09:04:49 -08:00
beads/crew/fang
7b0f398f11 fix(lint): address gosec, misspell, and unparam warnings
- gate.go: fix "cancelled" → "canceled" misspelling, add #nosec for
  validated GitHub IDs in exec.Command, mark checkTimer escalated as
  intentionally false, rename unused ctx param
- sync_divergence.go: add #nosec for git commands with validated paths,
  mark unused path param
- sync_branch.go: add #nosec for .git/info/exclude permissions
- setup.go: add #nosec for config file permissions
- recipes.go: add #nosec for validated config file paths
- external_deps.go: add #nosec for SQL with generated placeholders

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 22:06:52 -08:00
giles
ee179f5b6d feat(doctor): add deep integration check for pre-commit framework (bd-28r5)
Add config parsing for .pre-commit-config.yaml to detect if bd hooks are
configured. pre-commit is popular enough to warrant full support alongside
lefthook and husky.

Changes:
- Add CheckPrecommitBdIntegration() function to parse YAML config
- Check hooks.*.entry field for 'bd hooks run' pattern
- Handle stages field to determine which git hooks are configured
- Support legacy stage names (commit -> pre-commit, push -> pre-push)
- Add pre-commit to checkManagerBdIntegration switch statement
- Add comprehensive tests for all scenarios

Now supported managers with deep integration checks:
- lefthook (YAML, TOML, JSON)
- husky (.husky/ scripts)
- pre-commit (.pre-commit-config.yaml)

Detection-only managers (cannot verify config):
- overcommit, yorkie, simple-git-hooks

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 21:09:36 -08:00
giles
41d1e5b1de fix(doctor): improve messaging for detection-only hook managers (bd-par1)
When bd doctor detects hook managers we can't fully check (pre-commit,
overcommit, yorkie, simple-git-hooks), it now shows an informational
message instead of a warning:

  ✓ pre-commit detected (cannot verify bd integration)
    └─ Ensure your hook config calls 'bd hooks run <hook>'

Previously it incorrectly warned that these managers were "not calling bd"
when we simply couldn't verify their config.

Changes:
- Add DetectionOnly field to HookIntegrationStatus
- Set DetectionOnly=true for unsupported managers in CheckExternalHookManagerIntegration
- Update CheckGitHooks and CheckSyncBranchHookCompatibility to show
  informational message for detection-only managers
- Add test coverage for DetectionOnly behavior

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 21:05:56 -08:00
emma
1c8a88447b fix(npm): android only supports arm64 in goreleaser
The test incorrectly listed x64 as a supported arch for android, but
goreleaser only builds arm64 for android/termux.
2026-01-05 20:06:51 -08:00
Ariff Azman
2a579a539b feat: add native Android/Termux binary support (#887)
feat: added android support for running with termux

Adds GOOS=android arm64 build to goreleaser and platform detection in npm postinstall.

Tested by contributor on Termux where os.platform() returns 'android' and Linux binaries fail due to bionic vs glibc.
2026-01-05 20:06:25 -08:00
beads/crew/wolf
a61cbde692 fix(sync): handle .beads/redirect in git status checks (bd-arjb)
When running from a crew directory with .beads/redirect pointing to a shared
beads directory in another repo, git status commands would fail with:
  fatal: /path/to/mayor/rig/.beads: is outside repository

The fix detects when beadsDir is redirected and runs git commands from the
directory containing the actual .beads/ using git -C <targetRepoDir>.

Updated functions:
- gitHasBeadsChanges(): checks redirect and runs git from target repo
- gitHasUncommittedBeadsChanges(): same fix for pre-flight check

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 19:57:19 -08:00
Roelof Blom
ffd2e2273c feat(doctor): detect external hook managers and check bd integration (#908)
Add detection for external git hook managers (lefthook, husky, pre-commit,
overcommit, yorkie, simple-git-hooks) and check if they have bd hooks
integration configured.

- Detect manager config files in various locations/formats
- Parse lefthook YAML/TOML/JSON to check for `bd hooks run` commands
- Check husky hook scripts for bd integration
- Report which hooks have bd integration vs missing
- Use --chain flag in `bd doctor --fix` when external managers detected
- Detect active manager from git hooks when multiple present

Executed-By: mayor
Role: mayor
2026-01-05 19:12:14 -08:00
greghughespdx
e212683103 fix(update): add prefix routing like bd show (bd-618f) (#905)
bd update now uses resolveAndGetIssueWithRouting in direct mode,
matching bd show's prefix routing behavior. This enables cross-rig
issue updates from any directory using prefix-based routing.

Changes:
- Use resolveAndGetIssueWithRouting for ID resolution with routing
- Iterate over original args instead of pre-resolved IDs
- Use routed store (issueStore) and resolved ID throughout
- Remove early ID resolution that was blocking routing in direct mode
- Add proper result.Close() calls for resource cleanup

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 19:12:02 -08:00
Peter Chanthamynavong
e7d543af55 fix(sync): persist sync branch to yaml and database (GH#909) (#910)
Problem:
- Sync branch configuration was not consistently saved across storage types
- State divergence between database and config.yaml files

Solution:
- Update Set to write configuration to both yaml and database backends
- Add regression test for yaml configuration persistence

Impact:
- Guarantees configuration consistency across system reboots
- Prevents sync settings from being lost when reading from yaml
2026-01-05 19:11:55 -08:00
aaron-sangster
504e980669 fix(doctor): align duplicate detection with bd duplicates (bd-sali) (#917)
- Exclude closed issues from duplicate detection (previously only excluded tombstones)
- Use full content hash: title + description + design + acceptanceCriteria + status
- Add comprehensive test coverage for duplicate detection edge cases

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 19:11:38 -08:00
aaron-sangster
b86ce0a7e0 fix(doctor): query metadata table instead of config for last_import_time (#916)
The sync_divergence check was querying the wrong table. The sync code
writes last_import_time to the metadata table, but doctor was looking
in config. This caused spurious "No last_import_time recorded" warnings
even when sync was working correctly.

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 19:11:17 -08:00
emma
7db052a48e fix(formula): add phase=vapor to beads-release (gt-mjsjv)
Prevents accidental 'bd pour' from creating persistent issues.
Vapor formulas should only run via 'gt sling --formula' or 'bd mol wisp'.
2026-01-05 00:03:57 -08:00
fang
0caf648487 feat: add --filter-parent as alias for --parent in bd list (bd-3p4u) 2026-01-04 23:51:02 -08:00
emma
9b84ef73dd fix(sync): atomic export and force-push detection (bd-3bhl, bd-4hh5)
bd-3bhl: Add sync rollback on git commit failure
- Use exportToJSONLDeferred() instead of exportToJSONL() for atomic sync
- Call finalizeExport() only after git commit succeeds
- Rollback JSONL from git HEAD on commit failure
- Add rollbackJSONLFromGit() helper function
- Coverage: regular commit, sync branch, external beads repo paths

bd-4hh5: Fix false-positive force-push detection
- Use explicit refspec in CheckForcePush fetch
- +refs/heads/beads-sync:refs/remotes/origin/beads-sync
- Ensures tracking ref is always created/updated
- Fixes stale ref comparison causing false positives

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 23:14:11 -08:00
dave
d7221f6858 chore: Bump version to 0.44.0
Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-04 23:08:58 -08:00
dave
6730fce9b1 feat(setup): refactor to recipe-based architecture (bd-i3ed)
Replace tool-specific setup commands with a generic recipe-based system.
New tools become config entries, not code changes.

Changes:
- Add internal/recipes/ package with Recipe type and built-in recipes
- Add --list flag to show available recipes
- Add --print flag to output template to stdout
- Add -o flag to write template to arbitrary path
- Add --add flag to save custom recipes to .beads/recipes.toml
- Add built-in recipes: windsurf, cody, kilocode (new)
- Legacy recipes (cursor, claude, gemini, aider, factory) continue to work

The recipe system enables:
- Adding new tool support without code changes
- User-defined recipes in .beads/recipes.toml
- Shared template across all file-based integrations

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-04 21:57:09 -08:00
Jeff McDonald
053d005956 fix(show): display external_ref field in text output (#899)
The external_ref field was stored correctly and visible in --json
output, but missing from the human-readable text display.

Added External Ref line after other metadata fields in both daemon
and direct mode paths. Added tests for external_ref display.
2026-01-04 17:30:04 -08:00