2.9 KiB
2.9 KiB
Next Session Prompt: Dolt/Beads Database Recovery and Source-of-Truth Reconciliation
You are continuing work in beadboard.
Problem snapshot (as of 2026-02-28)
Bead state appears empty in bd ready, but .beads/issues.jsonl contains historical data.
Observed signals:
bd statusreports only 3 closed issues (0 open/in_progress/blocked)..beads/issues.jsonlhas 381 lines.bd doctor --dry-runreports:- Dolt-JSONL count mismatch (
Dolt has 3, JSONL has 381) - stale/merge artifacts and lock issues
- config mismatch hints in
.beads/metadata.json
- Dolt-JSONL count mismatch (
- Prior repair attempt hit lock/permission conflicts (
database is locked by another dolt process).
Goal
Restore BeadBoard to a consistent, usable state where bd in this repo reflects the expected issue set, and bd ready shows correct ready work.
Non-goals
- No frontend feature work.
- No broad refactors.
- No destructive git resets.
Required outcomes
- Clear diagnosis of why Dolt state diverged from JSONL state.
- Safe repair path applied (or a precise blocker report if repair cannot complete).
- Post-repair verification evidence showing issue counts and ready-state are sane.
- Short write-up on recurrence prevention.
Guardrails
- Treat
.beads/issues.jsonlas historical source candidate, but verify before forcing import. - Avoid direct manual edits to
.beads/issues.jsonl. - Use
bdcommands and documented repair flows first. - Do not run destructive git commands.
Suggested execution order
-
Capture baseline evidence
bd wherebd statusbd readybd list --status open --status in_progress --status blocked --jsonwc -l .beads/issues.jsonlbd doctor --dry-run
-
Check lock/process state
- Identify active
bd/doltprocesses. - Identify stale lock files in
.beads. - Resolve lock conflicts in a non-destructive way.
- Identify active
-
Repair using bd-supported flow
- Attempt
bd doctor --fix --source=jsonl --yes. - If still divergent, run focused checks (
bd doctor --check=validate,bd doctor --check=artifacts). - If needed, document and execute the minimal additional
bdrecovery command sequence.
- Attempt
-
Reconcile and verify
- Re-run
bd status,bd ready,bd list --json. - Confirm counts are no longer
3 vs 381divergent. - Confirm expected open/ready beads appear.
- Re-run
-
Record root cause + prevention
- Add a concise note in docs (or bead notes) on:
- root cause
- repair steps that worked
- required hygiene (locks, hooks, sync flow, config keys)
- Add a concise note in docs (or bead notes) on:
Deliverables
- Repair summary with command evidence.
- Final healthy
bdstatus/ready output summary. - Minimal prevention checklist for future sessions.
Completion criteria
bdissue inventory in this repo is consistent with expected project history.bd readyis no longer falsely empty due to DB divergence.- No destructive repository actions were used.