feat(doctor): add fresh clone detection check (bd-4ew)

Add CheckFreshClone function that detects when JSONL contains issues
but no database exists. Recommends 'bd init --prefix <detected-prefix>'
to hydrate the database. This check appears early in doctor output
to guide users on fresh clones.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-11-28 22:15:23 -08:00
parent 675b7a43b7
commit 13b2ab6c95
4 changed files with 321 additions and 67 deletions

View File

@@ -451,6 +451,14 @@ func runDiagnostics(path string) doctorResult {
return result
}
// Check 1a: Fresh clone detection (bd-4ew)
// Must come early - if this is a fresh clone, other checks may be misleading
freshCloneCheck := convertDoctorCheck(doctor.CheckFreshClone(path))
result.Checks = append(result.Checks, freshCloneCheck)
if freshCloneCheck.Status == statusWarning || freshCloneCheck.Status == statusError {
result.OverallOK = false
}
// Check 2: Database version
dbCheck := checkDatabaseVersion(path)
result.Checks = append(result.Checks, dbCheck)