Remove ~/.beads fallback behavior

- Remove ~/.beads/default.db fallback from FindDatabasePath()
- Update daemon to error if no database found instead of falling back
- Update main.go to require explicit database initialization
- Add help/version/quickstart to commands that don't need database
- Add MCP client debug logging for database routing

Amp-Thread-ID: https://ampcode.com/threads/T-2b757a14-cf10-400e-a83c-30349182dd82
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-10-17 10:56:52 -07:00
parent 49f3faf5d7
commit a971762b0e
4 changed files with 24 additions and 29 deletions

View File

@@ -53,9 +53,8 @@ func NewSQLiteStorage(dbPath string) (Storage, error) {
// FindDatabasePath discovers the bd database path using bd's standard search order:
// 1. $BEADS_DB environment variable
// 2. .beads/*.db in current directory or ancestors
// 3. ~/.beads/default.db (fallback)
//
// Returns empty string if no database is found at (1) or (2) and (3) doesn't exist.
// Returns empty string if no database is found.
func FindDatabasePath() string {
// 1. Check environment variable
if envDB := os.Getenv("BEADS_DB"); envDB != "" {
@@ -67,15 +66,7 @@ func FindDatabasePath() string {
return foundDB
}
// 3. Try home directory default
if home, err := os.UserHomeDir(); err == nil {
defaultDB := filepath.Join(home, ".beads", "default.db")
// Only return if it exists
if _, err := os.Stat(defaultDB); err == nil {
return defaultDB
}
}
// No fallback to ~/.beads - return empty string
return ""
}