beads/cmd/bd/doctor
Bella-Giraffety 5a2fc61f7a
fix: repair shared-server bootstrap and doctor metadata drift (#3242)
Reconcile local metadata.json against the authoritative server state in
shared-server/server mode. Repairs two drift cases:
1. Stale dolt_database when another server DB matches the local project_id
2. Stale/missing local project_id when the configured DB has one

Also hardens the server metadata probe:
- Escapes backticks in database names to prevent SQL injection
- Distinguishes expected probe errors (table/DB not found) from unexpected
  ones (permission denied, connection failures) so reconciliation does not
  act on an incomplete server inventory

Co-authored-by: Bella-Giraffety <thalia.geraghty@fiserv.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-03 14:42:21 -07:00
..
fix fix: repair shared-server bootstrap and doctor metadata drift (#3242) 2026-05-03 14:42:21 -07:00
agent.go Document supported go install modes (bd-o5a) (#3480) 2026-04-25 11:30:19 -07:00
agent_test.go /{cmd,docs,internal}: get bootstrap and init working correctly and remote agnostic 2026-04-10 14:37:49 -07:00
artifacts.go Fix doctor hangs in non-interactive and artifact scans (GH-3092) (#3109) 2026-04-07 15:31:58 -07:00
artifacts_test.go Fix doctor hangs in non-interactive and artifact scans (GH-3092) (#3109) 2026-04-07 15:31:58 -07:00
backend.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
bare_parent_fallback_test.go /{cmd,docs,internal}: more cleanup 2026-03-31 12:33:52 -07:00
checks_nocgo.go cleanup: remove 3-way merge engine remnants (GH#2391) 2026-03-10 14:08:54 -07:00
circuit.go Use getting started docs as bugs to fix (#3034) 2026-04-05 16:09:58 -07:00
claude.go Fix doctor hangs in non-interactive and artifact scans (GH-3092) (#3109) 2026-04-07 15:31:58 -07:00
claude_test.go fix: use explicit path params in doctor checks instead of relative paths 2026-03-01 19:23:55 -08:00
config_values.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
config_values_test.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
database.go fix: repair shared-server bootstrap and doctor metadata drift (#3242) 2026-05-03 14:42:21 -07:00
database_test.go fix(doctor): fail closed for server-mode integrity recovery 2026-03-18 11:21:19 -05:00
deep.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
deep_test.go refactor: remove duplicate DB() method from DoltStore (bd-ar6) 2026-02-23 12:53:01 -08:00
doctor_worktree_test.go test: add worktree test for doctor beads dir resolution 2026-04-08 07:46:05 +09:00
dolt.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
dolt_e2e_test.go fix(ci): drop ICU linkage from test jobs, use -tags gms_pure_go everywhere (#3240) 2026-04-14 10:01:46 -07:00
dolt_phantom_test.go /{cmd,internal,scripts}: use dsn helpers 2026-04-06 15:56:37 -07:00
dolt_test.go /cmd/bd/doctor: formatting 2026-03-31 12:38:22 -07:00
federation.go refactor: remove gastown/Gas Town string references from beads code and docs (bd-1ue8) 2026-03-20 18:39:50 -07:00
federation_test.go fix: ApplyCLIAutoStart respects ServerModeExternal (#3473) 2026-04-25 12:44:38 -07:00
fresh_clone_server.go /{cmd,docs,internal}: get bootstrap and init working correctly and remote agnostic 2026-04-10 14:37:49 -07:00
fresh_clone_server_test.go fix(doctor): resolve Dolt password/TLS for externally-hosted servers (#3361) 2026-04-20 17:55:33 -07:00
git.go test: add worktree test for doctor beads dir resolution 2026-04-08 07:46:05 +09:00
git_hygiene_test.go Follow up remaining runtime .beads fallbacks after GH#3124 (#3183) 2026-04-10 21:23:14 -07:00
git_repo_template_test.go Test isolation follow-up: consolidate and guard hooksPath leakage (#2234) (#2237) 2026-03-01 14:41:08 -08:00
git_test.go fix: bd doctor detects stale .legacy hook sidecars calling removed bd hook (GH#2398) 2026-03-10 13:55:55 -07:00
git_test_helpers_test.go test: add git helper and guard annotations 2025-12-28 20:48:37 -08:00
gitignore.go test: add worktree test for doctor beads dir resolution 2026-04-08 07:46:05 +09:00
gitignore_test.go /{cmd,docs,internal}: more cleanup 2026-03-31 12:33:52 -07:00
hooks_migration.go fix: warn on user-modified legacy hooks during migration 2026-03-05 15:29:19 -08:00
hooks_migration_test.go fix: validate marker count and order in detectHookMarkerState (bd-d96s) 2026-03-01 15:53:01 -08:00
installation.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
installation_test.go fix(doctor): honor bare worktree shared-store fallback 2026-03-23 17:31:27 +09:00
integrity.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
integrity_path_cgo_test.go Fix doctor target-path repo fingerprint resolution (beads-upstream-103) 2026-03-15 01:41:35 -05:00
integrity_test.go fix: add doctor subsystem test coverage and fix 3 bugs (bd-0jkc) 2026-03-01 15:13:19 -08:00
kv.go refactor(config): deprecate git-portable/belt-and-suspenders sync modes (gt-vemg9q.5) 2026-02-21 17:49:38 -08:00
legacy.go doctor: detect AGENTS.md / CLAUDE.md user-authored divergence (#3600) 2026-04-30 13:26:31 -07:00
legacy_test.go doctor: detect AGENTS.md / CLAUDE.md user-authored divergence (#3600) 2026-04-30 13:26:31 -07:00
locks.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
locks_test.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
maintenance.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
maintenance_cgo_test.go perf(doctor): speed up tests from 44s to ~12s via branch-per-test isolation 2026-02-28 23:40:24 -08:00
maintenance_test.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
migration.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
migration_hooks_test.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
migration_test.go refactor: remove tombstone/soft-delete system (Phase 4) 2026-02-14 21:22:24 -08:00
migration_validation.go Follow up remaining runtime .beads fallbacks after GH#3124 (#3183) 2026-04-10 21:23:14 -07:00
migration_validation_nocgo.go fix: nocgo stubs return StatusWarning instead of StatusOK for skipped checks (bd-lars) 2026-03-01 19:51:27 -08:00
migration_validation_nocgo_test.go fix: update tests for nocgo StatusWarning change and repoPath params 2026-03-01 19:51:27 -08:00
migration_validation_test.go fix: gofmt formatting and remove dead TestCheckDoltLocks_NotDoltBackend 2026-03-02 20:42:26 -08:00
multirepo.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
multirepo_test.go fix: replace hand-rolled YAML parser with yaml.Unmarshal in multirepo.go (bd-7fsv) 2026-03-01 19:10:01 -08:00
nocow.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
nocow_linux.go fix: set FS_NOCOW_FL on .beads/ at init to avoid btrfs kworker thrashing (#3162) 2026-04-10 21:52:18 -07:00
nocow_other.go fix: set FS_NOCOW_FL on .beads/ at init to avoid btrfs kworker thrashing (#3162) 2026-04-10 21:52:18 -07:00
nocow_test.go fix: set FS_NOCOW_FL on .beads/ at init to avoid btrfs kworker thrashing (#3162) 2026-04-10 21:52:18 -07:00
perf.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
perf_dolt.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
perf_dolt_test.go perf(doctor): speed up tests from 44s to ~12s via branch-per-test isolation 2026-02-28 23:40:24 -08:00
quick.go chore: Bump version to 0.55.1 2026-02-19 21:30:49 -08:00
quick_test.go fix: refresh last_import_time after write commands to prevent false staleness (#2255) 2026-03-01 21:51:37 -08:00
remotes.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
remotes_test.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
role.go Fix init leaving beads.role unset in edge cases (GH#2950) (#2964) 2026-04-01 17:00:41 -07:00
role_test.go Fix init leaving beads.role unset in edge cases (GH#2950) (#2964) 2026-04-01 17:00:41 -07:00
server.go fix(doctor): resolve Dolt password/TLS for externally-hosted servers (#3361) 2026-04-20 17:55:33 -07:00
server_test.go fix(doctor): resolve Dolt password/TLS for externally-hosted servers (#3361) 2026-04-20 17:55:33 -07:00
shared_store.go refactor(doctor): simplify shared-store beads resolution 2026-03-23 17:37:20 +09:00
shared_store_test.go fix(doctor): honor bare worktree shared-store fallback 2026-03-23 17:31:27 +09:00
suppress.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
suppress_test.go feat(doctor): allow suppressing specific warnings via config (GH#1095) 2026-03-03 16:57:50 -08:00
test_helpers_test.go fix: worktree-aware fingerprint prevents repo ID mismatch (GH-2867) (#3123) 2026-04-07 20:35:01 -07:00
tracked_runtime.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
tracked_runtime_test.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
types.go feat: remove JSONL sync-branch pipeline, replace with Dolt-in-Git 2026-02-18 20:13:55 -08:00
types_test.go feat: remove JSONL sync-branch pipeline, replace with Dolt-in-Git 2026-02-18 20:13:55 -08:00
validation.go Fix worktree-aware config.yaml resolution (#3265) 2026-04-24 07:33:31 -07:00
validation_test.go refactor: remove gastown/Gas Town string references from beads code and docs (bd-1ue8) 2026-03-20 18:39:50 -07:00
version.go Fix doctor hangs in non-interactive and artifact scans (GH-3092) (#3109) 2026-04-07 15:31:58 -07:00
version_test.go Fix doctor hangs in non-interactive and artifact scans (GH-3092) (#3109) 2026-04-07 15:31:58 -07:00