Commit Graph

5292 Commits

Author SHA1 Message Date
aleiby
fabf857b2a fix(test): skip permission test on WSL (#1115)
WSL doesn't fully respect Unix file permission semantics - the file
owner can bypass read-only restrictions, similar to macOS. Add isWSL()
helper and skip TestMergeDriverWithLockedConfig_E2E on WSL.

Fixes bd-srv

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 19:23:04 -08:00
Bobby Johnson
55e733cf62 fix: enable building on Windows without CGO (#1117)
The dolt storage backend requires CGO due to its gozstd dependency.
This change makes the dolt backend optional using build tags, allowing
`go install` to work on Windows where CGO is disabled by default.

Changes:
- Add BackendFactory registration pattern to factory package
- Create factory_dolt.go with `//go:build cgo` constraint that
  registers the dolt backend only when CGO is available
- Update init.go to use factory instead of direct dolt import
- When dolt backend is requested without CGO, provide helpful error
  message directing users to pre-built binaries

The sqlite backend (default) works without CGO and covers the majority
of use cases. Users who need dolt can either:
1. Use pre-built binaries from GitHub releases
2. Enable CGO by installing a C compiler

Fixes #1116
2026-01-15 19:23:02 -08:00
Dmitry Verkhoturov
c1a9dda173 fix: allow shell completions to work without a database (#1118)
Add "__complete" to noDbCommands list so that Cobra's internal completion
command can run without requiring a beads database to be present.

Previously, running shell completions (e.g., `bd show <TAB>`) in a directory
without a .beads database would fail with "no beads database found" error.

Now completions return empty results gracefully when no database exists,
allowing basic command completion to work everywhere while issue ID
completion still requires a database.

Added integration test that verifies __complete command works without a database.
2026-01-15 19:22:55 -08:00
Peter Chanthamynavong
5d93aaf722 fix(sync): remove orphaned restoreBeadsDirFromBranch function (#1121)
Remove dead code that was inadvertently orphaned when PR #918 refactored
the sync flow. The function was never called since v0.47.0.

The function caused GH#1100 by running `git checkout HEAD -- .beads/`
which restored the entire .beads/ directory, overwriting uncommitted
config.yaml changes.

Add regression test (TestConfigPreservedDuringSync) to prevent similar
restoration logic from being reintroduced.

Fixes #1100
2026-01-15 19:22:52 -08:00
LoomDeBWiles
c40affd601 fix(storage): normalize timestamps to UTC to prevent validation failures (#1123)
All time.Now() calls in the dolt storage layer now use time.Now().UTC()
to ensure consistent timezone handling. Previously, timestamps could be
stored with mixed timezone formats (UTC 'Z' vs local '+01:00'), causing
bv validation to fail when updated_at appeared earlier than created_at
in absolute time.

Files modified:
- transaction.go: CreateIssue, UpdateIssue, CloseIssue
- issues.go: CreateIssue, CreateIssues, UpdateIssue, CloseIssue, markDirty, manageClosedAt
- rename.go: UpdateIssueID (2 locations)
- events.go: AddIssueComment (2 locations)
- dirty.go: SetExportHash
- queries.go: Overdue filter, GetStaleIssues

Fixes: bd-84gw9

Co-authored-by: LoomDeBWiles <loomenwiles@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 19:22:50 -08:00
aleiby
490e9f695f fix: exclude role and rig types from bd ready (#1105)
Role and rig beads are reference metadata that should never be closed
or appear as actionable work. They are similar to agent beads which
are already excluded.

- Add 'role' and 'rig' to the issue type exclusion list in GetReadyWork
- Update comments to document the excluded types

Fixes confusion where role/rig beads appeared in bd ready output,
leading agents to try to close them as regular work items.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 19:20:58 -08:00
Graeme Foster
68403ae631 fix(release): add Nix package steps to release molecule (#1108)
* fix(release): add Nix package steps to release molecule

Add missing Nix support to the release workflow:
- bump-default-nix: Updates version in default.nix
- update-vendorhash: Prompts to update vendorHash if go.mod changed
- Add default.nix to verify-versions check

This was lost when bump-version.sh was replaced with the molecule
workflow in 39dbe90a. The original Nix support from c802f27f included
vendorHash detection in bump-version.sh, but that logic was not
migrated to the new workflow.

Fixes #1107

* fix(nix): update vendorHash for current go.mod
2026-01-15 19:20:51 -08:00
Bo
6b5bebfa12 fix(routing): handle symlinked .beads directories correctly (#1112)
When .beads is a symlink (e.g., ~/gt/.beads -> ~/gt/olympus/.beads),
findTownRoutes() incorrectly used filepath.Dir() on the resolved
symlink path to determine the town root.

This caused route resolution to fail because the town root would be
~/gt/olympus instead of ~/gt, making routes point to non-existent
directories.

The fix adds findTownRootFromCWD() which walks up from the current
working directory instead of the beads directory path. This finds
the correct town root regardless of symlink resolution.

Changes:
- Add findTownRootFromCWD() function
- Update findTownRoutes() to use CWD-based town root detection
- Add fallback to filepath.Dir() for non-Gas Town repos
- Add debug logging (BD_DEBUG_ROUTING=1)
- Add comprehensive test case

Test: go test ./internal/routing/...
2026-01-15 19:20:42 -08:00
mayor
d3db8253ff fix(storage): use factory for cross-repo routing to respect backend config
When routing issues to other repos (via contributor routing or --rig flag),
the code was hardcoding sqlite.New instead of using the storage factory.
This meant Dolt-configured repos would fail when receiving routed issues.

Changed two locations:
- Contributor routing (line 357): use factory.NewFromConfig
- createInRig --rig flag (line 789): use factory.NewFromConfig

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 12:44:12 -08:00
beads/crew/dave
28a7f10955 fix(lint): add nolint comments for gosec G201/G104 in dolt storage
The SQL formatting warnings (G201) are safe because:
- Placeholders only contain "?" markers for parameterized queries
- WHERE/SET clauses use validated column names with ? placeholders
- Refs are validated by validateRef() before use in AS OF queries
- LIMIT values are safe integers from filter.Limit

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 11:42:05 -08:00
beads/crew/dave
fe67e9e232 fix(test): fix TestInitNoDbMode for no-db mode config persistence
Changes:
- Save issue-prefix in config.yaml when using --no-db mode
  (previously only saved in database which doesn't exist in no-db mode)
- Add config.ResetForTesting() to allow reloading config in tests
- Simplify test to verify config values rather than execute subsequent
  commands (cobra's flag caching makes multi-Execute() testing complex)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 11:37:57 -08:00
beads/crew/dave
81828db6ef fix(test): remove pre-existing issues.jsonl in TestExportOnlySync
setupGitRepo now creates an empty issues.jsonl for RepoContext,
which triggers 'JSONL changed since import' validation in tests
that set up their own .beads/ directory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 08:02:20 -08:00
Peter Chanthamynavong
0a48519561 feat(context): centralize RepoContext API for git operations (#1102)
Centralizes repository context resolution via RepoContext API, fixing bugs where git commands run in the wrong repo when BEADS_DIR points elsewhere or in worktree scenarios.
2026-01-15 07:55:08 -08:00
beads/crew/emma
159114563b chore(release): v0.47.2
- Dolt backend (experimental)
- bd show --children flag
- NixOS support improvements
- Fix redirect + sync-branch incompatibility
- Fix doctor project-level settings detection
- Fix contributor routing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 21:57:28 -08:00
beads/crew/emma
39dbe90ade refactor: replace bump-version.sh with molecule pointer
The complex bump-version.sh script has been replaced with:
1. A deprecation notice pointing to the release molecule
2. A simpler update-versions.sh for quick local-only version bumps

For releases, use:
  bd mol wisp beads-release --var version=X.Y.Z

The molecule provides guided, step-by-step release workflows with
proper handoffs and CI gates.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 21:53:06 -08:00
beads/crew/fang
d1722d9204 docs: update daemon CLI syntax from flags to subcommands
Update all documentation to use the new subcommand syntax:
- `bd daemon --start` → `bd daemon start`
- `bd daemon --stop` → `bd daemon stop`
- `bd daemon --status` → `bd daemon status`
- `bd daemon --health` → `bd daemon status --all`
- `--global=false` → `--local`

The old flag syntax is deprecated but still works with warnings.

Closes: bd-734vd

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 21:47:15 -08:00
mayor
669ea40684 feat(storage): add --backend flag for Dolt backend selection
Phase 2 of Dolt integration - enables runtime backend selection:

- Add --backend flag to bd init (sqlite|dolt)
- Create storage factory for backend instantiation
- Update daemon and main.go to use factory with config detection
- Update database discovery to find Dolt backends via metadata.json
- Fix Dolt schema init to split statements for MySQL compatibility
- Add ReadOnly mode to skip schema init for read-only commands

Usage: bd init --backend dolt --prefix myproject

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 21:42:31 -08:00
beads/crew/emma
e861a667fc chore: add role templates and gitignore bd_test
- Add witness, deacon, refinery role templates
- Ignore bd_test binary (bd-test was already ignored)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 21:14:45 -08:00
beads/refinery
218ee6d2b4 bd daemon sync: 2026-01-13 11:50:27 2026-01-14 21:14:45 -08:00
beads/crew/dave
213c11453f bd sync: 2026-01-13 01:22:58 2026-01-14 21:14:45 -08:00
mayor
1dc36098a3 feat(storage): add Dolt backend for version-controlled issue storage
Implements a complete Dolt storage backend that mirrors the SQLite implementation
with MySQL-compatible syntax and adds version control capabilities.

Key features:
- Full Storage interface implementation (~50 methods)
- Version control operations: commit, push, pull, branch, merge, checkout
- History queries via AS OF and dolt_history_* tables
- Cell-level merge instead of line-level JSONL merge
- SQL injection protection with input validation

Bug fixes applied during implementation:
- Added missing quality_score, work_type, source_system to scanIssue
- Fixed Status() to properly parse boolean staged column
- Added validation to CreateIssues (was missing in batch create)
- Made RenameDependencyPrefix transactional
- Expanded GetIssueHistory to return more complete data

Test coverage: 17 tests covering CRUD, dependencies, labels, search,
comments, events, statistics, and SQL injection protection.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 21:06:10 -08:00
beads/crew/emma
bf7d51a73f docs: deprecate EXTENDING.md custom tables approach
Add deprecation notice explaining:
- SQLite → Dolt migration removes custom table support
- External integrations should use standalone sync tools
- Point to jira-beads-sync as the model

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 20:59:13 -08:00
Steve Yegge
43ce905896 fix(doctor): detect MCP server in project-level settings (#1104)
Apply same fix as #1091 to isMCPServerInstalled(): check all three
settings locations (user-level, project-level, and project-local).

- Extract checkMCPInSettings() helper function
- Check ~/.claude/settings.json, .claude/settings.json, and
  .claude/settings.local.json
- Add TestIsMCPServerInstalledProjectLevel with positive and negative cases

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 20:53:51 -08:00
beads/crew/giles
511129693e fix(create): remove unused routedToTarget variable
The variable was declared and set but never actually used for anything,
just assigned to blank identifier. Clean up dead code from PR #1088.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 20:51:52 -08:00
James MacAulay
12e0caf90e fix(doctor): detect plugin and hooks in project-level settings (#1091)
* fix(doctor): detect beads plugin in project-level settings

isBeadsPluginInstalled() now checks project-level settings files
(.claude/settings.json and .claude/settings.local.json) in addition
to user-level settings (~/.claude/settings.json).

This fixes the contradictory bd doctor output where the plugin check
passes but the integration check warns "Not configured" when the
plugin is enabled at project scope.

Fixes #1090

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

* fix(doctor): detect Claude hooks in project-level settings.json

hasClaudeHooks() was missing .claude/settings.json - it only checked
.claude/settings.local.json for project-level hooks.

Now checks all three locations:
- ~/.claude/settings.json (user-level)
- .claude/settings.json (project-level)
- .claude/settings.local.json (project-level, gitignored)

Also uses filepath.Join consistently for cross-platform compatibility.

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 20:51:16 -08:00
Peter Chanthamynavong
31239495f1 fix(routing): complete bd init --contributor routing (bd-6x6g) (#1088)
Implements the missing contributor routing logic so bd init --contributor actually works. Contributors' issues automatically route to ~/.beads-planning/ while maintainers' issues stay local.
2026-01-14 20:50:56 -08:00
Michael
b9d2799d29 fix(docs): update command syntax from '--' to single argument format for start, stop and status. (#1086) 2026-01-14 20:43:07 -08:00
beads/crew/dave
9e639da5ba fix(create): allow creating issues with explicit ID that matches tombstone (bd-0gm4r)
When using `bd create --id=<id>` where the ID matches an existing
tombstone (from `bd delete --hard --force`), the creation now succeeds
by first deleting the tombstone and all related records.

This enables use cases like polecat respawn where a worker needs to
recreate an issue with the same ID.

Changes:
- queries.go: Check for tombstone before insert, delete it if found
  (cleans up events, labels, dependencies, comments, dirty_issues)
- tombstone_test.go: Add regression test

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

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-14 20:36:47 -08:00
beads/crew/dave
3298c45e4b fix(sync): handle redirect + sync-branch incompatibility (bd-wayc3)
When a crew worker's .beads/ is redirected to another repo, bd sync
now detects this and skips all git operations (sync-branch worktree
manipulation). Instead, it just exports to JSONL and lets the target
repo's owner handle the git sync.

Changes:
- sync.go: Detect redirect early, skip git operations when active
- beads.go: Update GetRedirectInfo() to check git repo even when
  BEADS_DIR is pre-set (findLocalBdsDirInRepo helper)
- validation.go: Add doctor check for redirect + sync-branch conflict
- doctor.go: Register new check, remove undefined CheckMisclassifiedWisps

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

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-14 20:36:30 -08:00
beads/crew/giles
ff67b88ea9 docs: Add agent warning about interactive bd edit command
The bd edit command opens an interactive editor ($EDITOR) which AI agents
cannot use. Added warnings to AGENTS.md, AGENT_INSTRUCTIONS.md, and
cmd/bd/AGENTS.md directing agents to use bd update with flags instead.

Fixes: bd-3ft33

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 20:58:07 -08:00
beads/crew/grip
53d8a1cdb6 docs(skill): update beads skill documentation to v0.47.1
- Update SKILL.md version from 0.43.0 to 0.47.1
- Update prerequisites from v0.34.0+ to v0.43.0+
- Add v0.47.0+ row to README.md version compatibility table
- Update CLI_REFERENCE.md version from 0.21.0+ to 0.47.0+
- Document new v0.47 features:
  - bd list --ready flag (v0.47.1)
  - bd ready --gated for gate-resume discovery
  - bd create --dry-run for previewing issue creation
  - bd resolve-conflicts for JSONL merge conflict resolution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 19:41:29 -08:00
Steve Yegge
e069c04a67 Merge pull request #1077 from Atmosphere-Aviation/fix/bd-sync-redirect-handling
fix(sync): Handle redirected beads directories in gitCommitBeadsDir
2026-01-13 18:36:01 -08:00
beads/crew/emma
c51022a3d6 chore: add role templates and gitignore bd_test
- Add witness, deacon, refinery role templates
- Ignore bd_test binary (bd-test was already ignored)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 18:03:43 -08:00
Steve Yegge
d544f278a5 Merge pull request #1073 from niklas-wortmann/junie
feat: add Junie agent integration
2026-01-13 13:06:18 -08:00
Steve Yegge
b5fbbb3a09 Merge pull request #1067 from Atmosphere-Aviation/fix/gate-list-closed-section
Fix bd gate list: Separate closed gates into own section
2026-01-13 13:06:15 -08:00
slit
f36c8f6556 fix(sync): Handle redirected beads directories in gitCommitBeadsDir
When beads directory is redirected to a different repository (via bd-arjb),
gitCommitBeadsDir() was running git add from the current working directory's
repo root instead of the beads directory's repo root, causing exit status 128.

This fix adds the same redirect handling already present in gitHasBeadsChanges()
and gitHasUncommittedBeadsChanges() - checking GetRedirectInfo() and using
filepath.Dir(beadsDir) as the repo root when redirected.

Fixes: git add failed: exit status 128 errors during bd sync
2026-01-13 11:51:20 -08:00
grip
cae793b843 fix(bd): show 'no children' message when issue has no children
The --children flag would produce no output for issues without children.
Initialize the map entry in processIssue so the display loop can show
"No children found" message.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 11:42:30 -08:00
Steve Yegge
d28d1f0788 Merge pull request #1071 from pentop/fix/comments-short-id
fix: resolve short IDs in comments add/list daemon mode (#1070)
2026-01-13 11:41:42 -08:00
Julian Knutsen
a2bf15ee48 feat(bd): add --children flag to bd show command (#1069)
Adds a --children flag to the bd show command that displays only the
children of the specified issue. This is useful for quickly viewing
child steps of an epic without the full issue details.

The flag supports:
- Default mode: shows children with full dependency line formatting
- --short mode: shows compact one-liner per child
- --json mode: outputs children in JSON format

Fixes gt-lzf3.5

Co-authored-by: toast <julianknutsen@users.noreply.github>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 11:41:28 -08:00
dependabot[bot]
f27fed9577 chore(deps): bump golang.org/x/mod from 0.31.0 to 0.32.0 (#1058)
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.31.0 to 0.32.0.
- [Commits](https://github.com/golang/mod/compare/v0.31.0...v0.32.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-version: 0.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-13 11:29:21 -08:00
Joe Blubaugh
7a20235d7e Add nvim-beads plugin to community tools list (#1066) 2026-01-13 11:28:58 -08:00
Rhyd Lewis
9c5274cfdc docs: Add 'beads-dashboard' to community tools list (Web UIs) (#1072)
Added a new tool entry for 'beads-dashboard' with details on its functionality and author.
2026-01-13 11:28:49 -08:00
Matthew Jacobi
7096c61fbe Update link to full instructions in AGENTS.md (#1075) 2026-01-13 11:28:25 -08:00
Jan-Niklas W
d475e424c2 feat: add Junie agent integration
Add support for JetBrains Junie AI agent:
- Create .junie/guidelines.md with workflow instructions
- Create .junie/mcp/mcp.json for MCP server configuration
- Add 'junie' to BuiltinRecipes in recipes.go
- Add runJunieRecipe() handler in setup.go
- Add website documentation
- Add integrations/junie/README.md

Usage: bd setup junie
2026-01-13 08:41:25 -06:00
Mike
66007ac3ea fix: resolve short IDs in comments add/list daemon mode (#1070)
Add daemonClient.ResolveID() calls before AddComment and ListComments
operations in daemon mode, following the pattern from update.go.

Previously, short IDs (e.g., "5wbm") worked with most bd commands but
failed with `comments add` and `comments list` when using the daemon.
The short ID was passed directly to the RPC server which expected full
IDs (e.g., "prefix-5wbm").

Changes:
- cmd/bd/comments.go: Add ID resolution before daemon RPC calls
- internal/rpc/comments_test.go: Update tests to reflect client-side
  resolution pattern (RPC server expects full IDs, CLI resolves first)

Fixes: https://github.com/steveyegge/beads/issues/1070
2026-01-13 13:28:30 +00:00
Mike
1f84f7cce3 test: add failing tests for short ID support in comments (#1070)
Add tests demonstrating that `bd comments add` and `bd comments list`
don't accept short IDs in daemon mode, while other commands do.

Tests added:
- TestCLI_CommentsAddShortID (cli_fast_test.go)
  - Tests short ID, partial ID, and comment alias in direct mode (passes)

- TestCommentAddWithShortID (internal/rpc/comments_test.go)
  - Tests RPC layer with short ID (FAILS - demonstrates bug)

- TestCommentListWithShortID (internal/rpc/comments_test.go)
  - Tests listing comments with short ID (FAILS - demonstrates bug)

The fix should add daemonClient.ResolveID() before AddComment/ListComments,
following the pattern in update.go and label.go.

Refs: https://github.com/steveyegge/beads/issues/1070
2026-01-13 13:22:19 +00:00
nux
d69bf4faa8 Fix bd gate list: Separate closed gates into own section
Previously, displayGates() always showed 'Open Gates' header even when
closed gates were included via --all flag. Also, closed gates would
appear mixed with open gates under the misleading 'Open Gates' header.

Changes:
- Modified displayGates() to accept showAll parameter
- Separates gates into 'Open Gates' and 'Closed Gates' sections
- Closed gates only shown when --all flag is used
- Fixed handleGateList RPC handler to use ExcludeStatus instead of
  Status filter for consistency with CLI behavior

Fixes gas-town issue go-47m
2026-01-13 00:46:50 -08:00
beads/refinery
a55b9c3064 chore: update sync-branch to beads-metadata 2026-01-13 00:35:24 -08:00
dennis
c9cc1308d5 fix(test): ignore mtime-only changes in repo beads guard
The test guard was flagging false positives when SQLite shm/wal files
had their mtime updated from read-only operations (config loading, etc.)
without any actual content modification.

Now only reports when file size changes, which indicates actual content
modification rather than just file access.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 00:20:48 -08:00
beads/refinery
82a824ed92 bd daemon sync: 2026-01-13 00:17:32 2026-01-13 00:17:32 -08:00