Commit Graph

5244 Commits

Author SHA1 Message Date
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
beads/refinery
0625726e53 bd daemon sync: 2026-01-12 23:53:27 2026-01-13 00:14:12 -08:00
dennis
f703237c3d fix(ready): prevent wisps from appearing in bd ready
Add multiple layers of defense against misclassified wisps:
- Importer auto-detects -wisp- pattern and sets ephemeral flag
- GetReadyWork excludes -wisp- IDs via SQL LIKE clause
- Doctor check 26d detects misclassified wisps in JSONL

This addresses recurring issue where wisps with missing ephemeral
flag would pollute bd ready output after JSONL import.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 00:14:12 -08:00
fang
12c7bef159 chore(nix): update vendorHash for go.mod changes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 23:54:57 -08:00
fang
2332e6f5bd fix: update tests for getCurrentBranchOrHEAD and getPIDFileForSocket
- sync_git_test.go: getCurrentBranchOrHEAD now returns 1 value (not 2)
- daemon_basics_test.go: getPIDFileForSocket uses dbPath not socketPath
- daemon_autostart.go: mark unused socketPath param with underscore

These tests were broken by recent refactors that changed function signatures
but didn't update the corresponding test files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 23:51:56 -08:00
beads/refinery
0c95d695db Merge sync branch 'beads-sync' 2026-01-12 23:50:06 -08:00
Bob Cotton
c802f27fe5 feat: comprehensive NixOS support improvements (#1024)
* feat: comprehensive NixOS support improvements

This commit adds full NixOS support and automates Nix package maintenance:

## Static Linux Binaries for NixOS

Changes .goreleaser.yml to create static Linux binaries:
- Set CGO_ENABLED=0 for Linux amd64 and arm64 builds
- Remove cross-compiler dependencies (aarch64-linux-gnu-gcc)
- Simplifies build process while fixing NixOS compatibility

Static binaries work on all Linux distributions including NixOS, Alpine,
and musl-based distros without dynamic linker dependencies.

## Automated default.nix Version Management

Adds default.nix to the version bump workflow:
- Updates default.nix version field in bump-version.sh (new step 9)
- Adds default.nix to version verification checks
- Prevents version drift (was 5 releases behind: 0.42.0 vs 0.47.0)
- Updates README.md to remove glibc 2.32+ requirement

## Automated vendorHash Management

Creates scripts/update-nix-vendorhash.sh to automate vendorHash updates:
- Automatically detects correct hash by triggering Nix build error
- Extracts hash from error message and updates default.nix
- Verifies update with clean build
- Eliminates error-prone manual copy-paste workflow
- Works with local Nix OR Docker (uses nixos/nix image automatically)

Integrates vendorHash check into bump-version.sh:
- Detects when go.mod or go.sum have changed
- Prompts to run vendorHash update script interactively
- Catches synchronization issues at release time

## Documentation

Updates AGENTS.md with Nix package maintenance guide:
- Documents when and how to update vendorHash
- Recommends automated script as primary method
- Provides manual and alternative methods as fallback
- Notes Docker fallback for maintainers without Nix

## Impact

- NixOS users can now install via standard methods
- Nix package version stays synchronized automatically
- vendorHash updates work without Nix installed (via Docker)
- vendorHash updates are caught during release workflow
- All Linux users benefit from more portable binaries

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

* fix: address PR review feedback for NixOS support

Fixes three issues identified in PR review:

1. Replace undefined log_* functions in bump-version.sh with existing
   echo pattern (log_warning, log_info, log_success, log_error were
   called but not defined)

2. Update default.nix version from 0.42.0 to 0.47.0 to fix version
   drift with cmd/bd/version.go

3. Remove Nix Package Maintenance section from AGENTS.md per beads
   architecture (use bd prime for dynamic context, keep AGENTS.md
   minimal)

* fix: update versions to 0.47.1 after merge with main

- Update claude-plugin plugin.json to 0.47.1
- Update default.nix to 0.47.1
- Fixes version check failures after merging latest main branch

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-12 23:46:33 -08:00
emma
ef94ca8d38 sync: beads changes 2026-01-12 23:32:27 -08:00
Zach Barahal
7de4b428f3 fix: use dbPath instead of socketPath for beadsDir derivation (#1064)
When using short socket paths (workspaces with paths >103 chars),
filepath.Dir(socketPath) returns /tmp/beads-XXXXX/ instead of the
actual .beads/ directory. This caused TryDaemonLock to look in the
wrong location, always return false, clean up the startlock, and
recurse infinitely causing stack overflow.

Changed 4 occurrences in acquireStartLock, handleStaleLock,
handleExistingSocket, and getPIDFileForSocket to use
filepath.Dir(dbPath) which correctly points to .beads/.

Fixes: gt-qlt

Co-authored-by: furiosa <mayor@gastown.local>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 23:06:00 -08:00
dependabot[bot]
17e7f53e15 chore(deps): bump actions/upload-pages-artifact from 3 to 4 (#1055)
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-12 23:05:05 -08:00
beads/crew/grip
931187f493 fix: remove unused error return from getCurrentBranchOrHEAD
The function always returns nil for error since it is designed to
return HEAD on detached HEAD state. Simplify signature to just
return string.

Fixes golangci-lint unparam warning.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 19:43:44 -08:00
beads/crew/emma
66c5c4d805 feat(doctor): add check for stale .beads/mq/ files (bd-dx2dc)
Add bd doctor check that detects legacy gastown merge queue JSON files
in .beads/mq/. These files are local-only remnants from the old mrqueue
implementation and can safely be deleted since gt done already creates
merge-request wisps in beads.

- CheckStaleMQFiles() detects .beads/mq/*.json files
- FixStaleMQFiles() removes the entire mq directory
- Comprehensive tests for check and fix

This is the first step toward removing the mrqueue side-channel from
gastown. The follow-up convoy will update Refinery/Witness to use
beads exclusively.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 19:42:51 -08:00
garnet
e8a4474788 fix(storage): use strict INSERT for batch issue creation (GH#956)
Add insertIssuesStrict function that uses plain INSERT instead of
INSERT OR IGNORE. Update bulkInsertIssues and transactional CreateIssues
to use the strict variant.

This fixes a race condition where INSERT OR IGNORE could silently skip
duplicate insertions, but the code would still attempt to record events
for those "inserted" issues, causing FOREIGN KEY constraint failures.

The strict INSERT will now fail explicitly if a duplicate is encountered,
which should never happen since checkForExistingIDs runs first within
the same transaction.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 19:42:04 -08:00
dependabot[bot]
b3a77eb32d chore(deps): bump actions/setup-node from 4 to 6 (#1054)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-12 19:41:15 -08:00
beads/crew/emma
3854bb29e9 feat(doctor): add check for last-touched file tracking
Add bd doctor check that warns if .beads/last-touched is tracked by git.
This file is local runtime state that should never be committed, as it
causes spurious diffs in other clones.

- CheckLastTouchedNotTracked() detects if file is git-tracked
- FixLastTouchedTracking() untracks with git rm --cached
- Comprehensive tests for all scenarios

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 19:37:57 -08:00
dependabot[bot]
8ea1f970e1 chore(deps): bump actions/checkout from 4 to 6 (#1057)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Steve Yegge <steve.yegge@gmail.com>
2026-01-12 19:35:02 -08:00
beads/crew/grip
265242a103 fix: sync plugin.json version to 0.47.1
The plugin.json was left at 0.47.0 while all other version files
were bumped to 0.47.1, causing CI failures on all PRs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 19:30:16 -08:00
dependabot[bot]
f827086b27 chore(deps): bump golang.org/x/term from 0.38.0 to 0.39.0 (#1059)
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.38.0 to 0.39.0.
- [Commits](https://github.com/golang/term/compare/v0.38.0...v0.39.0)

---
updated-dependencies:
- dependency-name: golang.org/x/term
  dependency-version: 0.39.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-12 19:30:07 -08:00
dependabot[bot]
b9a1ef6128 chore(deps): bump fastmcp in /integrations/beads-mcp (#1060)
chore(deps): bump fastmcp from 2.14.1 to 2.14.3 in /integrations/beads-mcp

Bug fixes in this release:
- Fix HTTP transport timeout defaulting to 5 seconds
- OAuth token storage TTL fix
- Redis key prefix for ACL isolation
- ContextVar propagation for ASGI-mounted servers
2026-01-12 19:30:02 -08:00
beads/crew/dave
ec1a32b9a8 fix(storage): add reconnectMu RLock protection to prevent race condition (#1054)
Add missing reconnectMu.RLock() protection to storage methods that were
vulnerable to the same race condition fixed in GH#607. The FreshnessChecker
can trigger reconnect() which closes s.db while queries are in flight,
causing "database is closed" errors during daemon export operations.

Protected methods:
- labels.go: GetLabelsForIssues (GetLabels intentionally unprotected - called from GetIssue which holds lock)
- comments.go: GetIssueComments, GetCommentsForIssues
- dependencies.go: GetDependencyCounts, GetDependencyRecords, GetAllDependencyRecords, GetDependencyTree, loadDependencyGraph
- config.go: SetConfig, GetConfig, GetAllConfig, DeleteConfig, SetMetadata, GetMetadata
- dirty.go: MarkIssueDirty, GetDirtyIssues, GetDirtyIssueHash, GetDirtyIssueCount
- events.go: GetEvents, GetStatistics, GetMoleculeProgress
- hash.go: All hash methods
- hash_ids.go: GetNextChildID, ensureChildCounterUpdated (getNextChildNumber unprotected - called internally)

Internal helpers called from already-locked contexts intentionally omit
RLock to avoid deadlock (Go's RWMutex doesn't support recursive locking).

Fixes: bd-vx7fp

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

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-12 18:29:42 -08:00
Steve Yegge
6b9be4595a Merge pull request #1033 from phredrick42/fix-jj-detached-head-upstream-check
fix(daemon): check sync-branch upstream for jj/jujutsu compatibility
2026-01-12 17:30:06 -08:00
Ismar
d931f81427 feat: add prek support as pre-commit alternative (#1040)
prek (https://prek.j178.dev) is a faster Rust-based alternative to
pre-commit that uses the same .pre-commit-config.yaml config files.

Changes:
- Add prek detection pattern in hookManagerPatterns (before pre-commit
  to ensure correct detection since prek hooks may contain 'pre-commit')
- Handle prek in checkManagerBdIntegration using same config parser
- Update init_git_hooks.go to recognize prek-installed hooks
- Rename isPreCommit field to isPreCommitFramework for clarity
- Use regex pattern matching all pre-commit/prek signatures consistently
- Add test cases for prek run and prek hook-impl signatures

Co-authored-by: Ismar Iljazovic <ismar@gmail.com>
2026-01-12 17:29:57 -08:00
Conall O'Brien
a8f7c21a74 Add jira-beads-sync CLI+Claude plugin to COMMUNITY_TOOLS.md (#1052) 2026-01-12 17:28:11 -08:00
beads/refinery
c706e0ac0f sync: patrol cycle complete, queue empty 2026-01-12 16:46:12 -08:00
wolf
b171ab083c sync: closed bd-u1mcn (PR #1045 merged) 2026-01-12 16:44:15 -08:00
grip
24e0afc0f3 sync: closed bd-d7kdn 2026-01-12 16:43:42 -08:00
Peter Chanthamynavong
215f726be3 test: skip read-only file tests on macOS (#1047)
macOS allows file owners to write to their own read-only (0444) files,
so TestSetupGlobalGitIgnore_ReadOnly cannot exercise the "Unable to write"
code path on this platform.

Skip both test cases on darwin with an explanatory message.
2026-01-12 16:43:22 -08:00
grip
4a50cadba0 sync: update issues.jsonl 2026-01-12 16:43:14 -08:00
Ismar
dc28efe9d1 fix: isolate TestSetupGlobalGitIgnore_ReadOnly from user's git config (#1045)
The test was failing because it called 'git config --global core.excludesfile'
which returned the real user's gitignore path instead of using the test's
temp directory.

Fix: Set GIT_CONFIG_GLOBAL env var to an empty temp config file, ensuring
the test uses the temp directory's .config/git/ignore path as intended.

Also extracted the isolation logic into a reusable setupIsolatedGitConfig helper.

Co-authored-by: Ismar Iljazovic <ismar@gmail.com>
2026-01-12 16:42:30 -08:00
grip
1a849120e0 sync: update issues.jsonl 2026-01-12 16:42:29 -08:00
Ismar
75f03b782f fix: pass hookArgs to runPrePushHook for chained hook support (#1043)
Fixes #1041

The pre-push hook was not passing arguments to chained hooks,
causing them to fail. This change:

1. Changes runPrePushHook() to accept args []string parameter
2. Passes args to runChainedHook() instead of nil
3. Updates call site to pass hookArgs
4. Renames local 'args' to 'statusArgs' to avoid variable shadowing

Co-authored-by: Ismar Iljazovic <ismar@gmail.com>
2026-01-12 16:41:32 -08:00
beads/refinery
fb0a9816d8 bd daemon sync: 2026-01-12 16:41:23 2026-01-12 16:41:23 -08:00
beads/refinery
388ec7573b bd daemon sync: 2026-01-12 16:40:18 2026-01-12 16:40:18 -08:00
beads/refinery
9e2b8bea18 bd daemon sync: 2026-01-12 16:40:12 2026-01-12 16:40:12 -08:00
Eugene Sukhodolin
a157def42d fix(export): remove export from read-only commands to fix dirty issue clearing (#1036)
The export command was incorrectly listed in readOnlyCommands, causing the SQLite database to be opened in read-only mode. This prevented export from clearing dirty issues and updating the JSONL file hash.
2026-01-12 16:40:01 -08:00
dave
f64290e2a5 sync: beads/crew/dave
Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-12 16:39:52 -08:00
beads/refinery
b11f8056a7 bd daemon sync: 2026-01-12 16:39:09 2026-01-12 16:39:09 -08:00
Eugene Sukhodolin
7b8c322e68 fix(autoflush): preserve comments during full re-export triggered by hash mismatch (#1039)
Problem:
When a JSONL file hash mismatch was detected (e.g., after git operations
that modify the JSONL without updating export_hashes), the autoflush
system would trigger a full re-export. During this re-export, all issue
comments were silently dropped from the exported JSONL file.

Steps to reproduce:
1. Have a beads database with issues containing comments
2. Create a situation where JSONL hash doesn't match stored hash
   (e.g., clone a repo, or manual JSONL edits)
3. Run any bd command that triggers autoflush (e.g., `bd create foo`)
4. Observe warning: "JSONL file hash mismatch detected"
5. Check .beads/issues.jsonl - all comments are now missing

Root cause:
Two different export code paths existed:
- exportToJSONLWithStore (daemon_sync.go) - correctly populated comments
- fetchAndMergeIssues (autoflush.go) - only fetched dependencies, NOT comments

When hash mismatch triggered a full re-export via the autoflush path,
fetchAndMergeIssues was called but it never populated issue.Comments,
resulting in all comments being lost.

Fix:
Add GetIssueComments call in fetchAndMergeIssues to populate comments
for each issue before export, matching the behavior of exportToJSONLWithStore.

Note: Labels were not affected because GetIssue() already populates them
internally. Comments are stored in a separate table and require explicit
fetching via GetIssueComments().
2026-01-12 16:39:06 -08:00
beads/refinery
d8e3bf1c82 bd daemon sync: 2026-01-12 16:38:48 2026-01-12 16:38:48 -08:00
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
beads/refinery
216ea80f18 bd daemon sync: 2026-01-12 16:38:06 2026-01-12 16:38:06 -08:00
beads/refinery
df526638f5 bd daemon sync: 2026-01-12 16:37:03 2026-01-12 16:37:03 -08:00
beads/refinery
1770f75715 bd daemon sync: 2026-01-12 16:36:01 2026-01-12 16:36:01 -08:00
beads/refinery
f1d9bf65c6 bd daemon sync: 2026-01-12 16:35:32 2026-01-12 16:35:32 -08:00
beads/refinery
b4d305d9e8 bd daemon sync: 2026-01-12 16:35:30 2026-01-12 16:35:30 -08:00
beads/refinery
175b891413 bd daemon sync: 2026-01-12 16:35:28 2026-01-12 16:35:28 -08:00
beads/refinery
e9eef8d09a bd daemon sync: 2026-01-12 16:34:51 2026-01-12 16:34:51 -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
Phredrick Phool
228b7195b1 fix(sync): handle detached HEAD in bd sync --status
Add getCurrentBranchOrHEAD() which returns "HEAD" when in detached HEAD
state instead of failing. This fixes bd sync --status for jj/jujutsu users.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 07:09:25 -06:00