- 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
When .beads exists with issues.jsonl but no SQLite database, and config.yaml
has no-db: true, automatically enable JSONL-only mode instead of failing
with 'no beads database found'. Also improved error message to mention
--no-db option.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Create reusable error handling helpers to reduce boilerplate and
enforce consistency across the codebase:
- FatalError(format, args...): writes "Error: ..." to stderr and exits
- FatalErrorWithHint(message, hint): includes actionable suggestion
- WarnError(format, args...): writes "Warning: ..." to stderr
Prototyped in create.go to validate the approach - converted 13 error
patterns and 5 warning patterns. This reduces code from:
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
To simply:
FatalError("%v", err)
Also fixed countIssuesInJSONLFile reference after earlier refactoring.
See docs/ERROR_HANDLING.md for the three-pattern guideline.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Created docs/PERFORMANCE_TESTING.md with comprehensive coverage of:
- Running benchmarks (make bench, make bench-quick)
- Running specific benchmarks
- Understanding benchmark output (ns/op, allocs/op)
- CPU profiling with pprof and flamegraphs
- Memory profiling
- User diagnostics (bd doctor --perf)
- Comparing performance with benchstat
- Optimization tips and common patterns
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>