From ef50e80c2d6310a16f612522c437976c184ad5f6 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sat, 29 Nov 2025 13:32:51 -0800 Subject: [PATCH] Resolve merge conflicts in issues.jsonl and main.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- cmd/bd/main.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cmd/bd/main.go b/cmd/bd/main.go index 755584e9..68b0b4f1 100644 --- a/cmd/bd/main.go +++ b/cmd/bd/main.go @@ -289,33 +289,35 @@ var rootCmd = &cobra.Command{ jsonlPath := filepath.Join(beadsDir, "issues.jsonl") configPath := filepath.Join(beadsDir, "config.yaml") - // Check if JSONL exists and config.yaml has no-db: true + // Check if JSONL exists and config.yaml has no-db: true jsonlExists := false if _, err := os.Stat(jsonlPath); err == nil { jsonlExists = true } - isNoDbMode := false + isNoDbMode := false if configData, err := os.ReadFile(configPath); err == nil { isNoDbMode = strings.Contains(string(configData), "no-db: true") } - // If JSONL-only mode is configured, auto-enable it + // If JSONL-only mode is configured, auto-enable it if jsonlExists && isNoDbMode { noDb = true if err := initializeNoDbMode(); err != nil { fmt.Fprintf(os.Stderr, "Error initializing JSONL-only mode: %v\n", err) os.Exit(1) } - // Set actor from flag, viper, or env + // Set actor for audit trail if actor == "" { - if user := os.Getenv("USER"); user != "" { + if bdActor := os.Getenv("BD_ACTOR"); bdActor != "" { + actor = bdActor + } else if user := os.Getenv("USER"); user != "" { actor = user } else { actor = "unknown" } } - return + return // Skip SQLite initialization } } @@ -323,7 +325,7 @@ var rootCmd = &cobra.Command{ // - import: auto-initializes database if missing // - setup: creates editor integration files (no DB needed) if cmd.Name() != "import" && cmd.Name() != "setup" { - // No database found - error out instead of falling back to ~/.beads + // No database found - provide helpful error message fmt.Fprintf(os.Stderr, "Error: no beads database found\n") fmt.Fprintf(os.Stderr, "Hint: run 'bd init' to create a database in the current directory\n") fmt.Fprintf(os.Stderr, " or use 'bd --no-db' to work with JSONL only (no SQLite)\n")