beads/internal/storage/memory
paf0186 c96e62e6b5
fix: add atomic compare-and-swap semantics to bd claim (#1474)
* fix: add atomic compare-and-swap semantics to bd claim

The claim operation had a race condition where concurrent callers could
both pass the pre-check and claim the same issue. This fix:

- Adds ClaimIssue method to Storage interface with atomic CAS semantics
- Uses conditional UPDATE (WHERE assignee = '') to prevent race conditions
- Returns ErrAlreadyClaimed error when issue is already assigned
- Implements the fix in SQLite, Memory, and Dolt storage backends
- Updates RPC handler and CLI to use the new atomic method
- Adds comprehensive tests including concurrent claim scenarios

Closes the race window where multiple agents could both claim an issue.

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

* fix: add ClaimIssue to mockStorage in tests

The mockStorage struct used for interface compliance testing was missing
the new ClaimIssue method, causing build failures in CI.

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

* fix(nix): enable proxyVendor to fix GOTOOLCHAIN in module fetch phase

The Nix build was failing because the go-modules fetching phase uses
GOTOOLCHAIN=local by default, ignoring the env.GOTOOLCHAIN=auto setting.

Adding proxyVendor=true changes how modules are fetched in a way that
should allow GOTOOLCHAIN=auto to take effect, enabling Go to download
the required 1.25.6+ toolchain automatically.

Fixes #1476

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

* Revert "fix(nix): enable proxyVendor to fix GOTOOLCHAIN in module fetch phase"

This reverts commit a5b758cf1ac8bbadff774f5566144c3f0b94d561.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:07:40 -08:00
..
hyphenated_test.go fix: resolve remaining hyphenated ID issues in memory store and doctor 2025-11-20 19:01:30 -05:00
memory.go fix: add atomic compare-and-swap semantics to bd claim (#1474) 2026-02-03 15:07:40 -08:00
memory_more_coverage_test.go refactor(types): remove Gas Town type constants from beads core (bd-w2zz4) 2026-01-21 10:36:59 -08:00
memory_test.go feat(types): remove Gas Town types from core built-in types 2026-01-17 05:07:11 -08:00
ready_blocked_nodb_test.go refactor: remove unused bd pin/unpin/hook commands (bd-x0zl) 2025-12-27 16:02:15 -08:00
tree_test.go fix: bd --no-db dep tree now shows complete tree (GH#836) 2026-01-01 11:03:46 -08:00