Delete 6 CGO/nocgo stub files and remove //go:build cgo tags from
dolt.go and bootstrap.go. Beads now always operates in server mode
(dolt sql-server subprocess). Embedded mode references removed from
CLI help text and config commands.
Part of epic: Remove embedded Dolt mode (server-only operation).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The JSON version output now includes "cgo": bool, but tests
used map[string]string which cannot unmarshal booleans.
Changed to map[string]interface{} and added cgo field assertion.
All cmd/bd tests depend on the Dolt storage backend which requires CGO
(for ICU). Gate tests behind cgo build tag so they cleanly skip when
CGO is unavailable rather than failing at link time.
Extract listDoltMigrations() into build-tag-conditional helpers
(migrate_helpers_cgo.go / migrate_helpers_nocgo.go) so migrate.go
compiles without CGO.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This addresses the code smell of 20+ global variables in main.go by:
1. Creating CommandContext struct in context.go that groups all runtime state:
- Configuration (DBPath, Actor, JSONOutput, etc.)
- Runtime state (Store, DaemonClient, HookRunner, etc.)
- Auto-flush/import state
- Version tracking
- Profiling handles
2. Adding accessor functions (getStore, getActor, getDaemonClient, etc.)
that provide backward-compatible access to the state while allowing
gradual migration to CommandContext.
3. Updating direct_mode.go to demonstrate the migration pattern using
accessor functions instead of direct global access.
4. Adding test isolation helpers (ensureCleanGlobalState, enableTestModeGlobals)
to prevent test interference when multiple tests manipulate global state.
Benefits:
- Reduces global count from 20+ to 1 (cmdCtx)
- Better testability (can inject mock contexts)
- Clearer state ownership (all state in one place)
- Thread safety (mutexes grouped with the data they protect)
Note: Two pre-existing test failures (TestTrackBdVersion_*) are unrelated to
this change and fail both with and without these modifications.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update Makefile install target to extract and pass git commit/branch via ldflags
- Add -X main.Commit and -X main.Branch to all build configurations in .goreleaser.yml
- Create scripts/install.sh helper for explicit version control during installation
- Add comprehensive tests for commit/branch resolution and output formatting
Fixes github #503: 'bd version' now reports as-built commit hash and branch
information regardless of installation method (make install, go install, or
released binaries from goreleaser).
- Add -v, --version flag to root command
- Both bd --version and bd -v now print version info
- bd version subcommand continues to work as before
- Add tests for both flag variants
Amp-Thread-ID: https://ampcode.com/threads/T-583f9ef8-c358-48c5-91cf-c23a91bab9d7
Co-authored-by: Amp <amp@ampcode.com>