You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Projects initialized before #2142 (or via --database with hyphens) retain hyphenated dolt_database names in metadata.json. When upgrading to bd 1.0.0 — which defaults to embedded mode — embedded Dolt rejects these names with an unhelpful invalid database name error. All beads become inaccessible until the user manually edits metadata.json.
This is a remaining gap from the #2142 fix, which only addressed newbd init runs.
Every bd command fails: invalid database name: "my-project"
Gaps in current code
Component
Issue
newDoltStoreFromConfig
Passes hyphenated name directly to embedded engine — no sanitization
embeddeddolt error
Says invalid database name with no guidance on how to fix it
bd doctor
Hyphen check only runs in server mode (RunServerHealthChecks); embedded-default projects skip it entirely
ValidateDatabaseName
Allows hyphens ([a-zA-Z0-9_\-]), but embedded mode rejects them — inconsistent
checkMetadataConfigValues
Does not check dolt_database for embedded-incompatible characters
Impact
Any pre-#2142 project in a hyphenated directory (very common: my-project, cool-app, jtbot-core) becomes completely unusable after upgrading to embedded mode. The workaround — manually adding "dolt_mode": "server" or editing dolt_database — is undiscoverable.
Proposed Fix
1. Auto-sanitize on embedded store open (store_factory.go)
When newDoltStoreFromConfig is about to open an embedded store with a hyphenated database name:
Sanitize hyphens → underscores
Rename the existing database if it exists with the old name
Persist the sanitized name back to metadata.json
Log the migration for visibility
2. Better error in embedded mode (embeddeddolt/open.go, store.go)
If identifier validation fails and the name contains hyphens, add actionable guidance:
invalid database name "my-project": hyphens are not allowed in embedded mode.
Run 'bd doctor --fix' or replace hyphens with underscores in .beads/metadata.json dolt_database field.
3. Doctor check for embedded mode (doctor/config_values.go)
Add a dolt_database validation to checkMetadataConfigValues that flags hyphenated names when dolt_mode is not server.
4. Align --database validation with embedded mode (init.go)
When --database is provided and the build will use embedded mode, reject names that contain hyphens early (before any side effects).
Summary
Projects initialized before #2142 (or via
--databasewith hyphens) retain hyphenateddolt_databasenames inmetadata.json. When upgrading to bd 1.0.0 — which defaults to embedded mode — embedded Dolt rejects these names with an unhelpfulinvalid database nameerror. All beads become inaccessible until the user manually editsmetadata.json.This is a remaining gap from the #2142 fix, which only addressed new
bd initruns.Problem
How it happens
my-projectinitialized before bd init should sanitize hyphens to underscores in dolt_database name #2142, or used--database my-project(which passesValidateDatabaseNamesince it allows hyphens)metadata.jsoncontains"dolt_database": "my-project"bdcommand fails:invalid database name: "my-project"Gaps in current code
newDoltStoreFromConfigembeddeddolterrorinvalid database namewith no guidance on how to fix itbd doctorRunServerHealthChecks); embedded-default projects skip it entirelyValidateDatabaseName[a-zA-Z0-9_\-]), but embedded mode rejects them — inconsistentcheckMetadataConfigValuesdolt_databasefor embedded-incompatible charactersImpact
Any pre-#2142 project in a hyphenated directory (very common:
my-project,cool-app,jtbot-core) becomes completely unusable after upgrading to embedded mode. The workaround — manually adding"dolt_mode": "server"or editingdolt_database— is undiscoverable.Proposed Fix
1. Auto-sanitize on embedded store open (
store_factory.go)When
newDoltStoreFromConfigis about to open an embedded store with a hyphenated database name:metadata.json2. Better error in embedded mode (
embeddeddolt/open.go,store.go)If identifier validation fails and the name contains hyphens, add actionable guidance:
3. Doctor check for embedded mode (
doctor/config_values.go)Add a
dolt_databasevalidation tocheckMetadataConfigValuesthat flags hyphenated names whendolt_modeis notserver.4. Align
--databasevalidation with embedded mode (init.go)When
--databaseis provided and the build will use embedded mode, reject names that contain hyphens early (before any side effects).Environment
Related