Commit Graph

4758 Commits

Author SHA1 Message Date
Tim Visher
6da965587b Ensure daemon autostart lock dir exists (#1037)
Co-authored-by: OpenAI Codex <codex@openai.com>
2026-01-12 16:38:13 -08:00
fang
7eab16715f docs: update Jujutsu integration to use bd merge (GH#906)
- Remove standalone beads-merge binary section (no longer maintained)
- Update Jujutsu config to use `bd merge` instead of `beads-merge`
- Fix config path to standard `~/.config/jj/config.toml`
- Add note that tool only works for .beads/issues.jsonl

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 16:34:31 -08:00
beads/crew/emma
279192c5fb chore: Bump version to 0.47.1
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 03:21:12 -08:00
beads/crew/dave
4dae3fa338 feat(list): add --ready flag to show only available work (bd-ihu31)
The --ready flag filters to status=open, excluding hooked, in_progress,
blocked, and deferred issues. This makes it easy to see work that can
actually be picked up.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 02:05:13 -08:00
beads/refinery
70f7c0b586 bd daemon sync: 2026-01-12 02:01:59 2026-01-12 02:01:59 -08:00
mayor
1abfb56b74 chore: update last-touched 2026-01-12 01:35:22 -08:00
beads/crew/fang
6dfd7588b3 fix(mol): prevent nil pointer dereference in wisp create
GetIssue returns (nil, nil) when an issue is not found, but the code
assumed a non-nil issue when err was nil. Added nil checks before
accessing issue fields.

Fixes crash when running `bd mol wisp create` with nonexistent proto.

Closes: gt-2uzn2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 01:35:22 -08:00
Nicolas Suzor
7fe824781a fix: use route prefix when creating issues in rigs (#1028)
* fix(create): Use prefix from routes.jsonl when creating issues with --rig

When using `bd create --rig <name>`, the prefix from routes.jsonl was
being discarded. This caused issues to be created with the target
database's default prefix instead of the route's prefix.

This is particularly problematic when using the redirect mechanism to
share a single database across multiple rigs - the redirect correctly
routes to the shared database, but the prefix was not being applied.

The fix:
1. Capture the prefix from routing.ResolveBeadsDirForRig()
2. Temporarily override the target database's issue_prefix config
3. Restore the original prefix after issue creation

Example scenario that now works:
- routes.jsonl: {"prefix": "aops-", "path": "src/academicOps"}
- src/academicOps/.beads/redirect points to ~/writing/.beads
- `bd create --rig aops "Test"` now creates aops-xxx instead of ns-xxx

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

* fix(create): pass prefix via struct field instead of mutating config

The previous approach temporarily mutated the database's issue_prefix
config during cross-rig issue creation, then restored it afterward.
This was fragile in multi-user scenarios where concurrent operations
could see the wrong prefix.

New approach:
- Add PrefixOverride field to types.Issue
- CreateIssue checks PrefixOverride first, uses it if set
- createInRig sets issue.PrefixOverride instead of mutating config

This passes state as a parameter rather than mutating shared state,
making it safe for concurrent multi-user access.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-12 01:20:32 -08:00
emma
1c1dabcfdd fix(duplicates): prefer issues with children/deps when choosing merge target (GH#1022)
The duplicate merge target selection now considers structural relationships:
1. Dependent count (children, blocked-by) - highest priority
2. Text reference count - secondary
3. Lexicographically smallest ID - tiebreaker

This fixes the bug where `bd duplicates --auto-merge` would suggest closing
an epic with 17 children instead of the empty shell duplicate.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 00:45:25 -08:00
beads/crew/emma
8395105493 fix: remove stale plugin reference from .claude/settings.json
The enabledPlugins entry referenced beads@beads-marketplace which
does not exist, causing claude doctor to report a plugin error.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 22:25:55 -08:00
beads/crew/wolf
b9207b513c docs: clarify bd reset command and document workarounds (GH#922)
- Add Reset section to CLI_REFERENCE.md documenting bd admin reset
- Add troubleshooting section for "old data returns after reset"
- Clarify that --hard and --skip-init flags were never implemented
- Document workarounds for complete clean slate including remote data

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 20:45:38 -08:00
beads/crew/giles
0248895298 fix(sqlite): rebuild blocked_issues_cache after rename-prefix (GH#1016)
RenameDependencyPrefix updates issue IDs in the dependencies table but
was not rebuilding the blocked_issues_cache, leaving stale IDs in the
cache that no longer exist in the issues table.

Add invalidateBlockedCache() call at the end of RenameDependencyPrefix
to rebuild the cache with the new issue IDs.

Fixes: GH#1016

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 20:45:09 -08:00
beads/crew/emma
44c17012e5 fix(doctor): exclude sync_base.jsonl from multiple JSONL files check (#1021)
sync_base.jsonl is an internal sync mechanism file used for 3-way merge,
not a competing issue database. The doctor check now correctly ignores it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 20:44:29 -08:00
beads/crew/wolf
764f3747ba fix(merge): add QualityScore field to merge Issue struct
Add QualityScore *float32 field to internal/merge/merge.go to match
internal/types/types.go. Also add last-touched to .beads/.gitignore.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 18:46:12 -08:00
beads/crew/giles
355ce7345a feat(formula): improve beads-release with v0.47.0 learnings
Add preflight checks to prevent common release issues:
- preflight-worktree: Verify git context for worktree setups
- Enhanced preflight-git: Auto-stash guidance for non-release files
- Enhanced preflight-pull: Branch sync verification with recovery steps
- detect-half-done-release: Catch version mismatches upfront
- verify-changelog-complete: Ensure CHANGELOG covers all commits

Fixes: bd-beiz7

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 18:44:29 -08:00
Eugene Sukhodolin
04f0670582 feat(ui): add Markdown rendering to comment text (#1019)
Apply ui.RenderMarkdown() to comment text in both bd show and
bd comments commands. This enables syntax highlighting, code
blocks, and other Markdown formatting in comments.
2026-01-11 18:17:14 -08:00
Marvin Bitterlich
68da7c9f78 fix(mcp): support custom issue types and statuses (#1023)
Change IssueType and IssueStatus from Literal to str to support
custom types configured via:
  bd config set types.custom "agent,molecule,event"
  bd config set status.custom "awaiting_review,awaiting_testing"

The CLI handles validation of these values against the configured
options. The MCP layer is just a transport and shouldn't re-validate
what the CLI already validates.

This fixes Pydantic validation errors when listing issues that have
custom types like 'event', 'molecule', or 'agent'.

Built-in types: bug, feature, task, epic, chore
Built-in statuses: open, in_progress, blocked, deferred, closed
2026-01-11 18:17:01 -08:00
Eugene Sukhodolin
d04bffb9b6 fix(validation): support hyphenated prefixes in ValidateIDFormat (#1013)
* test(validation): add failing tests for hyphenated prefix parsing

Reproduces bug where `bd create --parent` fails for projects with
hyphenated prefixes like "bead-me-up" or "web-app".

Root cause: ValidateIDFormat splits on first hyphen, so:
  "bead-me-up-3e9.1" → prefix "bead" (wrong, should be "bead-me-up")

The bug flow in create.go:
1. User runs: bd create "Child" --parent bead-me-up-3e9
2. GetNextChildID generates: bead-me-up-3e9.1
3. ValidateIDFormat extracts: "bead" (splits at first hyphen)
4. ValidatePrefix compares: "bead" vs "bead-me-up" → MISMATCH

Tests added:
- TestValidateIDFormat: 6 cases for hyphenated prefix IDs
- TestValidateIDFormat_ParentChildFlow: simulates exact --parent flow,
  showing simple prefixes pass while hyphenated prefixes fail

Workaround: use --force flag to bypass prefix validation.

* fix(validation): support hyphenated prefixes in ValidateIDFormat

Use utils.ExtractIssuePrefix instead of naive first-hyphen splitting.
This fixes bd create --parent failing for projects with hyphenated
prefixes like "bead-me-up" or "web-app".

Before: "bead-me-up-3e9" → prefix "bead" (wrong)
After:  "bead-me-up-3e9" → prefix "bead-me-up" (correct)

ExtractIssuePrefix uses smart heuristics: split on last hyphen,
check if suffix is hash-like (3-8 chars, alphanumeric, digits for 4+).

* Update internal/validation/bead_test.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-11 18:16:48 -08:00
Bob Cotton
5941544a5e fix(init): prevent initialization from within git worktrees (#1026)
Add check to prevent 'bd init' from running inside a git worktree.
Worktrees should share the .beads database from the main repository,
not create their own.

The error message guides users to:
    1. Run 'bd init' from the main repository
    2. Use 'bd worktree create' to create worktrees with proper
        redirects

This prevents the confusing behavior where init would create files
in unexpected locations or fail with "pathspec '.beads/.gitignore' did
not match any files" errors.

According to docs/WORKTREES.md, the proper workflow is:
    - Initialize beads once in the main repository
    - Use 'bd worktree create' to create worktrees with redirect files
    - All worktrees share the single .beads/ database via redirects

    Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-11 18:15:57 -08:00
beads/crew/emma
f459ec2913 chore: Bump version to 0.47.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 00:25:32 -08:00
Jordan Hubbard
8c04eb7e7f docs(install): mention FreeBSD support (#1010)
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-01-11 00:03:18 -08:00
beads/crew/fang
0de6b10ac0 fix: add missing crystallizes column to SELECT queries and remove duplicate
- Remove duplicate crystallizes column from schema.go
- Add crystallizes to SELECT in transaction.go SearchIssues
- Add crystallizes to SELECT in ready.go GetReadyWork and GetNewlyUnblockedByClose
- Add crystallizes to SELECT in labels.go GetIssuesByLabel
- Add missing placeholder in issues.go INSERT VALUES
- Update migrations_test.go schema to include crystallizes column

Fixes test failures caused by schema/query column count mismatches.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 23:55:16 -08:00
beads/crew/emma
5528315838 Revert "docs: forbid crew workers from creating PRs"
This reverts commit d079af7cf9.
2026-01-10 23:52:43 -08:00
beads/crew/emma
d079af7cf9 docs: forbid crew workers from creating PRs
PRs are for external contributors. Crew workers commit directly to main.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 23:49:10 -08:00
beads/crew/fang
1d42732ad1 fix: add TypeRig constant and IsBuiltIn method (GH#1002)
- Add TypeRig IssueType constant for rig identity beads
- Add TypeRig to IsValid() switch statement
- Add IsBuiltIn() method for multi-repo hydration trust checks
- Add Crystallizes field to Issue struct and ComputeContentHash

Fixes validation rejecting documented issue types like 'rig' and 'agent'.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 23:46:44 -08:00
beads/crew/fang
f5cd36752d feat: add crystallizes column to sqlite storage
Adds crystallizes column for work economics (compounds vs evaporates)
per Decision 006. Includes migration 036 and updates to all INSERT/SELECT
queries in issues.go, queries.go, dependencies.go, and transaction.go.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 23:46:44 -08:00
Steve Yegge
0ed349b3ed fix(linear): use project_id when creating issues via sync --push (GH#973) (#1012)
The linear.project_id config was being read and used for filtering
when pulling issues from Linear, but was not being passed when
creating new issues via --push. Now CreateIssue includes projectId
in the mutation input when configured.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 23:46:00 -08:00
Steve Yegge
10d5f04f59 docs: add Windows Controlled Folder Access troubleshooting (GH#979) (#1011)
Add documentation for when `bd init` hangs on Windows due to Controlled
Folder Access blocking directory creation. Includes diagnosis steps and
solution to whitelist bd.exe.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 23:45:57 -08:00
beads/crew/giles
b420018b97 fix: validate sync.branch in team wizard and migrate commands (GH#923)
Two code paths bypassed syncbranch.ValidateSyncBranchName(), allowing
main/master to be set as sync.branch and causing worktree conflicts.
Now both use syncbranch.Set() for proper validation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 23:42:49 -08:00
beads/crew/dave
40ae598751 fix(lint): resolve unparam warnings in doctor and rpc packages
- multirepo.go: discoverChildTypes now returns []string instead of
  ([]string, error) since error was always nil
- socket_path.go: tmpDir changed from function to const since it
  always returned "/tmp" regardless of platform

Fixes CI lint failures caused by unparam linter detecting unused
error returns and constant function results.

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

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-10 23:17:37 -08:00
Eugene Sukhodolin
a731f5a48f fix(daemon): complete socket path shortening for long workspace paths (GH#1001) (#1008)
fix(daemon): socket path shortening for long workspace paths

Fixes GH#1001 where long workspace paths (e.g., pytest temp directories) caused
socket path mismatches. The daemon now uses rpc.ShortSocketPath() consistently
with the client.

Changes:
- daemon.go: Use rpc.ShortSocketPath() + EnsureSocketDir() for daemon socket
- daemon_config.go: Update getSocketPathForPID() to use rpc.ShortSocketPath()
- Added tests for long path handling and client-daemon socket path agreement

Co-Authored-By: Eugene Sukhodolin <sukhodolin@users.noreply.github.com>
2026-01-10 22:50:16 -08:00
Jordan Hubbard
89b5f8e203 Update installation instructions for FreeBSD support (#1009)
docs: add FreeBSD to installation instructions

Co-Authored-By: Jordan Hubbard <jordanhubbard@users.noreply.github.com>
2026-01-10 22:49:56 -08:00
Will Ness
cece38af16 docs: update paths for claude-plugin subdirectory structure (GH#985) (#1007)
Update documentation and scripts to reflect the plugin move from
root level to claude-plugin/ subdirectory:

- Fix command links in docs/DAEMON.md, docs/SYNC.md, examples/
- Update plugin.json path references in RELEASING.md, AGENT_INSTRUCTIONS.md
- Update scripts/bump-version.sh and scripts/check-versions.sh
- Update skill documentation paths in claude-plugin/skills/beads/

The marketplace.json correctly stays at .claude-plugin/ (root level)
while plugin.json moved to claude-plugin/.claude-plugin/.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 22:49:29 -08:00
beads/crew/dave
ac24a63187 fix: make tests resilient to project .beads/redirect
Tests were failing because beads.FindDatabasePath() follows the
project's .beads/redirect file, causing tests to find unexpected
databases. Fixed by:

- Setting BEADS_DIR in tests that need isolation from git repo detection
- Clearing BEADS_DIR in TestMain to prevent global contamination
- Updating migration test schema to include owner column

This ensures tests work correctly in crew directories that have
redirect files pointing to shared .beads directories.

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

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-10 22:38:04 -08:00
beads/crew/dave
f79e636000 feat: consolidate schema changes from crew directories
Merges schema additions from crew/fang, crew/giles, crew/grip, and crew/wolf:

- crystallizes: bool field for work economics (compounds vs evaporates)
- work_type: WorkType field for assignment model (mutex vs open_competition)
- source_system: string field for federation adapter tracking
- quality_score: *float32 for aggregate quality (0.0-1.0)
- delegated-from: new dependency type for work delegation chains

Migrations properly sequenced as 037-040 (after existing 036 owner_column).

Also fixes test compilation errors for removed TypeRig and IsBuiltIn references.

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

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-10 22:38:04 -08:00
Steve Yegge
8942261a12 fix: skip beads restore when directory is redirected (bd-lmqhe)
When a repo has a .beads/redirect file pointing to a shared beads
directory, restoreBeadsDirFromBranch would fail because it runs
git checkout from the local repo but with a path outside that repo.

Skip the restore when the beads directory is redirected since the
beads dir is managed by a different repo anyway.

Fixes: bd-lmqhe

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 22:09:13 -08:00
ruby
5605e590a3 fix(sqlite): prevent FK constraint failure on batch create (GH#956)
Add checkForExistingIDs check to transaction-based batch creation
(sqliteTxStorage.CreateIssues) before calling insertIssues. This
prevents INSERT OR IGNORE from silently skipping duplicate IDs,
which would cause FK constraint failures when recording events
for issues that weren't actually inserted.

Also fixes unrelated test bug: renamed parseCommaSeparated to
parseCommaSeparatedList in validators_test.go.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 22:02:03 -08:00
garnet
1ff8932468 test(rpc): add blocker check tests for close operation (GH#962)
Add two tests to verify that issue blocking/dependencies are enforced
when closing issues via the RPC handler:

- TestHandleClose_BlockerCheck: Verifies closing a blocked issue fails
  when blocker is still open, and --force flag overrides the check
- TestHandleClose_BlockerCheck_ClosedBlocker: Verifies close succeeds
  once the blocking issue is closed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 22:01:02 -08:00
beads/refinery
50a079d3b7 fix: repair test build failures in types and sqlite packages
- Add TypeRig constant to IssueType enum
- Add IsBuiltIn() method to IssueType for multi-repo hydration trust logic
- Fix parseCommaSeparated -> parseCommaSeparatedList function name in test

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 22:00:32 -08:00
Steve Yegge
d74a14d92a test(sync): add tests for redirect handling in git status checks
Add tests for gitHasBeadsChanges and gitHasUncommittedBeadsChanges
functions when .beads directory is redirected to another repo:

- Test non-redirected case (baseline functionality)
- Test redirected case with no changes (clean target repo)
- Test redirected case with changes (modified file in target)

These tests cover the redirect detection logic added in a61cbde6
that uses `git -C <targetRepoDir>` when beadsDir is redirected.

Closes: bd-hxcf

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 21:31:24 -08:00
Steve Yegge
5a772dca44 feat(doctor): add redirect configuration health checks
Add three new bd doctor checks for redirect configuration health:

1. CheckRedirectTargetValid - Verifies redirect target exists and
   contains a valid beads database

2. CheckRedirectTargetSyncWorktree - Verifies redirect target has
   beads-sync worktree when using sync-branch mode

3. CheckNoVestigialSyncWorktrees - Detects unused .beads-sync
   worktrees in redirected repos that waste space

These checks help diagnose redirect configuration issues in
multi-clone setups like Gas Town polecats and crew workspaces.

Closes bd-b88x3

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 21:30:05 -08:00
beads/crew/dave
a803da36e1 feat: add 'attests' edge type for skill attestations
Add new DependencyType 'attests' for skill attestations. Enables:
Entity X attests that Entity Y has skill Z at level N.

- Add DepAttests constant to dependency types
- Add AttestsMeta struct for skill, level, date, evidence, notes
- Update IsWellKnown() to include attests
- Add test cases for the new edge type

Foundation for HOP skill portability.

Closes: bd-2papc

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

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-10 19:33:47 -08:00
beads/crew/dave
ceb5769c75 feat: add owner field for human attribution in HOP CV chains
Add 'owner' field to Issue struct for tracking the human responsible
for the issue, distinct from 'created_by' which tracks the executor.
Owner is populated from git author email (GIT_AUTHOR_EMAIL or git
config user.email), per Decision 008 for CV accumulation.

Changes:
- Add Owner field to types.Issue with omitempty JSON tag
- Include Owner in content hash computation
- Add owner column migration (036_owner_column.go)
- Update all SQL queries to include owner field
- Add getOwner() helper using git author email fallback chain
- Populate owner in bd create command
- Add owner to RPC CreateArgs protocol

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

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-10 19:28:08 -08:00
emma
1039a69186 fix(daemon): silence deprecation warnings in --json mode
Follow-up fixes to PR #1006:
- Silence deprecation warnings when --json flag is set (agent ergonomics)
- Remove unused outputStatusJSON() function
- Remove unused encoding/json import from daemon_status.go

Agents parsing JSON output dont need deprecation warnings cluttering stderr.
The subcommand syntax (bd daemon start) remains the documented path forward.

See bd-ntl3b for deduplication work, bd-kpa7c for type consolidation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 16:31:16 -08:00
Ryan
d8d4a7ed2d refactor(daemon): consolidate CLI to subcommands with semantic styling (#1006)
Merging with plan to address in follow-up commits:
- Deduplicate daemon_start.go validation logic (call startDaemon())
- Silence deprecation warnings in --json mode for agent ergonomics
- Consolidate DaemonStatusReport with DaemonHealthReport
- Remove unused outputStatusJSON()
- Add tests for new subcommands
2026-01-10 16:28:52 -08:00
Erick Matsen
3f2b693bea fix: respect hierarchy.max-depth config setting (GH#995) (#997)
* fix: respect hierarchy.max-depth config setting (GH#995)

The hierarchy.max-depth config setting was being ignored because storage
implementations had the depth limit hardcoded to 3. This fix:

- Registers hierarchy.max-depth default (3) in config initialization
- Adds hierarchy.max-depth to yaml-only keys for config.yaml storage
- Updates SQLite and Memory storage to read max depth from config
- Adds validation to reject hierarchy.max-depth values < 1
- Adds tests for configurable hierarchy depth

Users can now set deeper hierarchies:
  bd config set hierarchy.max-depth 10

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

* refactor: extract shared CheckHierarchyDepth function (GH#995)

- Extract duplicated depth-checking logic to types.CheckHierarchyDepth()
- Update sqlite and memory storage backends to use shared function
- Add t.Cleanup() for proper test isolation in sqlite test
- Add equivalent test coverage for memory storage backend
- Add comprehensive unit tests for CheckHierarchyDepth function

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 13:36:52 -08:00
dave
69dae103db fix: add timeout to daemon request context to prevent indefinite hangs
reqCtx() now applies the server's requestTimeout (default 30s) to the
context returned for request handlers. This prevents bd list and other
commands from hanging indefinitely when database operations stall.

The fix ensures:
- All RPC handlers get a context with a deadline
- Database operations (using QueryContext) honor context cancellation
- reconnectMu read locks are released when context times out

Fixes: bd-p76kv

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

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-10 13:35:30 -08:00
giles
b844a3b656 fix: Windows infinite loop in findLocalBeadsDir and findOriginalBeadsDir (GH#996)
Same fix as PR #991 for FindBeadsDir() - the loop condition
dir != "/" && dir != "." doesn't handle Windows drive roots.
On Windows, filepath.Dir("C:\\") returns "C:\\", not "/" or ".".

Changed both functions to check parent == dir to detect filesystem root,
which works correctly on both Unix and Windows.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 13:34:53 -08:00
ohnotnow
bfae0e554c feat: add git user.name to actor fallback chain (#994)
- Insert git config user.name in fallback chain before final $USER default
- Consolidate duplicate actor resolution logic into single function
- Add BEADS_ACTOR as env var alias for MCP compatibility
- Add tests for actor resolution priority
- Update CONFIG.md with Actor Identity Resolution section

The new fallback order is:
  --actor flag > BD_ACTOR > BEADS_ACTOR > git user.name > $USER > "unknown"

Co-authored-by: Ohffs <ohffsnotnow@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 12:43:46 -08:00
wolf
3ecffa111b fix: relocate daemon socket for deep paths (GH#1001)
On Unix systems, socket paths are limited to 104 chars (macOS) or 108 chars
(Linux). Deep workspace paths like /Volumes/External Drive/Dropbox/...
would exceed this limit and cause daemon startup failures.

This fix:
- Adds ShortSocketPath() which computes /tmp/beads-{hash}/bd.sock for
  paths that would exceed the limit
- Keeps backward compatibility: short paths still use .beads/bd.sock
- Updates daemon discovery to check both locations
- Uses SHA256 hash of canonical workspace path for unique directories

Closes GH#1001

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 12:30:31 -08:00