The deletions.jsonl contained records for 79 'deleted' issues that were
actually just missing due to database corruption, not legitimately deleted.
Clearing this allows the issues to be restored.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Root cause: bd sync exports DB to JSONL BEFORE pulling from remote.
If the local DB is stale (fewer issues than JSONL), the stale data gets
exported and committed, potentially corrupting the remote when pushed.
The existing ZFC (Zero-Fill Check) only detected when DB had MORE issues
than JSONL, missing the dangerous reverse case.
Fix: Added "reverse ZFC" check in sync.go that detects when JSONL has
significantly more issues than DB (>20% divergence or empty DB).
When detected, it imports JSONL first to sync the database before
any export occurs.
This prevents stale/fresh clones from exporting their incomplete
database state over a well-populated JSONL file.
Version bump: 0.26.0 -> 0.26.1
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
bd sync corrupts issues.jsonl in multi-clone environments.
Using manual git add to avoid triggering the bug.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Restored from 4ef5a28a which has the correct state:
- 79 issues total
- 12 open
- 67 closed
The previous restore from bb39c8b6 had all issues incorrectly
closed by swarm syncs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
A bd sync during the swarm incorrectly purged all 80 issues from
issues.jsonl at commit 93718056. This restores the database state
from bb39c8b6 (the last good state before corruption).
Corruption occurred at 2025-11-29 13:35:28 during parallel polecat
syncs. Root cause investigation needed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed bug where issue IDs with multiple hyphens in the prefix and hash
suffixes were incorrectly parsed. For example, `web-app-a3f8e9` was
being parsed with prefix `web-` instead of `web-app`.
Root cause: ExtractIssuePrefix() only checked for numeric suffixes.
When it encountered a hash suffix, it fell back to using the first
hyphen instead of the last hyphen.
Changes:
- Added isLikelyHash() helper to detect hexadecimal hash suffixes (4-8 chars)
- Updated ExtractIssuePrefix() to handle both numeric and hash suffixes
- Added comprehensive test cases for various prefix patterns
Test coverage includes:
- web-app-123 (numeric suffix)
- web-app-a3f8e9 (hash suffix)
- my-cool-app-a3f8e9 (three-part prefix with hash)
- super-long-project-name-1a2b (four-part prefix)
- Various hash lengths and case variations
Co-authored-by: dubstylee <dubstylee@users.noreply.github.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- issues.jsonl: Keep closed status for bd-5kj (already resolved)
- main.go: Clean up JSONL-only mode detection, include BD_ACTOR env check
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add #nolint:gosec comments for reviewed file operations:
- cmd/bd/main.go:299 - G304: ReadFile from .beads/config.yaml (safe, constructed path)
- cmd/bd/daemon_health_unix.go:18 - G115: overflow is safe in disk space calculation
The upstream main branch has calls to countIssuesInJSONLFile in doctor.go and init.go,
but the previous fix removed the function definition. Add it back as a simple wrapper
around countJSONLIssues that returns only the count.
The Nix Flake CI test was failing because the repository has an existing
.beads/issues.jsonl file checked in, which caused bd init to refuse to
initialize (detecting it as a fresh clone with existing data).
Solution: Remove .beads before running bd init in the test to start fresh.
All file reads/writes are from controlled paths (.beads/, .git/, or git root).
Add #nosec comments to suppress G304 and G204 warnings.
- cmd/bd/doctor.go:664 - ReadFile from .beads/config.yaml
- cmd/bd/main.go:645 - ReadFile from .beads/{issues,beads}.jsonl
- cmd/bd/doctor/fix/database_config.go:166 - ReadFile from git root .gitattributes
- cmd/bd/doctor/fix/untracked.go:61 - exec Command with whitelisted JSONL files
Fixes build failure in Test, Lint, Test (Windows), and Test Nix Flake jobs.
The function was defined in both init.go and doctor.go. Removed the init.go
version which is now unused. The doctor.go version (which calls
countJSONLIssues) is the canonical implementation.
Fixes#19780439467
The Nix Flake CI test was failing because the repository has an existing
.beads/issues.jsonl file checked in, which caused bd init to refuse to
initialize (detecting it as a fresh clone with existing data).
Solution: Remove .beads before running bd init in the test to start fresh.
All file reads/writes are from controlled paths (.beads/, .git/, or git root).
Add #nosec comments to suppress G304 and G204 warnings.
- cmd/bd/doctor.go:664 - ReadFile from .beads/config.yaml
- cmd/bd/main.go:645 - ReadFile from .beads/{issues,beads}.jsonl
- cmd/bd/doctor/fix/database_config.go:166 - ReadFile from git root .gitattributes
- cmd/bd/doctor/fix/untracked.go:61 - exec Command with whitelisted JSONL files
Fixes build failure in Test, Lint, Test (Windows), and Test Nix Flake jobs.
The function was defined in both init.go and doctor.go. Removed the init.go
version which is now unused. The doctor.go version (which calls
countJSONLIssues) is the canonical implementation.
Fixes#19780439467