chore(gastown): scorched-earth SQLite removal from codebase

Remove all bd sync references and SQLite-specific code from gastown:

**Formulas (agent priming):**
- mol-polecat-work: Remove bd sync step from prepare-for-review
- mol-sync-workspace: Replace sync-beads step with verify-beads (Dolt check)
- mol-polecat-conflict-resolve: Remove bd sync from close-beads
- mol-polecat-code-review: Remove bd sync from summarize-review and complete-and-exit
- mol-polecat-review-pr: Remove bd sync from complete-and-exit
- mol-convoy-cleanup: Remove bd sync from archive-convoy
- mol-digest-generate: Remove bd sync from send-digest
- mol-town-shutdown: Replace sync-state step with verify-state
- beads-release: Replace restart-daemons with verify-install (no daemons with Dolt)

**Templates (role priming):**
- mayor.md.tmpl: Update session end checklist to remove bd sync steps
- crew.md.tmpl: Remove bd sync references from workflow and checklist
- polecat.md.tmpl: Update self-cleaning model and session close docs
- spawn.md.tmpl: Remove bd sync from completion steps
- nudge.md.tmpl: Remove bd sync from completion steps

**Go code:**
- session_manager.go: Remove syncBeads function and call
- rig_dock.go: Remove bd sync calls from dock/undock
- crew/manager.go: Remove runBdSync, update Pristine function
- crew_maintenance.go: Remove bd sync status output
- crew.go: Update pristine command help text
- polecat.go: Make sync command a no-op with deprecation message
- daemon/lifecycle.go: Remove bd sync from startup sequence
- doctor/beads_check.go: Update fix hints and Fix to use bd import not bd sync
- doctor/rig_check.go: Remove sync status check, simplify BeadsConfigValidCheck
- beads/beads.go: Update primeContent to remove bd sync references

With Dolt backend, beads changes are persisted immediately to the sql-server.
There is no separate sync step needed.

Part of epic: hq-e4eefc (SQLite removal)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
mayor
2026-01-25 14:06:13 -08:00
committed by Steve Yegge
parent 1d260d377b
commit b316239d12
21 changed files with 598 additions and 243 deletions
+6 -4
View File
@@ -62,6 +62,7 @@ func (c *BeadsDatabaseCheck) Run(ctx *CheckContext) *CheckResult {
}
// If database file is empty but JSONL has content, this is the bug
// Note: This check is for SQLite backend; Dolt backend doesn't use these files
if dbErr == nil && dbInfo.Size() == 0 {
if jsonlErr == nil && jsonlInfo.Size() > 0 {
return &CheckResult{
@@ -72,7 +73,7 @@ func (c *BeadsDatabaseCheck) Run(ctx *CheckContext) *CheckResult {
"This can cause 'table issues has no column named pinned' errors",
"The database needs to be rebuilt from the JSONL file",
},
FixHint: "Run 'gt doctor --fix' or delete issues.db and run 'bd sync --from-main'",
FixHint: "Run 'gt doctor --fix' or delete issues.db and run 'bd import'",
}
}
}
@@ -113,6 +114,7 @@ func (c *BeadsDatabaseCheck) Run(ctx *CheckContext) *CheckResult {
}
// Fix attempts to rebuild the database from JSONL.
// Note: This fix is for SQLite backend. With Dolt backend, this is a no-op.
func (c *BeadsDatabaseCheck) Fix(ctx *CheckContext) error {
beadsDir := filepath.Join(ctx.TownRoot, ".beads")
issuesDB := filepath.Join(beadsDir, "issues.db")
@@ -128,8 +130,8 @@ func (c *BeadsDatabaseCheck) Fix(ctx *CheckContext) error {
return err
}
// Run bd sync to rebuild from JSONL
cmd := exec.Command("bd", "sync", "--from-main")
// Run bd import to rebuild from JSONL
cmd := exec.Command("bd", "import")
cmd.Dir = ctx.TownRoot
var stderr bytes.Buffer
cmd.Stderr = &stderr
@@ -152,7 +154,7 @@ func (c *BeadsDatabaseCheck) Fix(ctx *CheckContext) error {
return err
}
cmd := exec.Command("bd", "sync", "--from-main")
cmd := exec.Command("bd", "import")
cmd.Dir = ctx.RigPath()
var stderr bytes.Buffer
cmd.Stderr = &stderr
+5 -32
View File
@@ -844,46 +844,19 @@ func (c *BeadsConfigValidCheck) Run(ctx *CheckContext) *CheckResult {
}
}
// Check sync status
cmd = exec.Command("bd", "sync", "--status")
cmd.Dir = c.rigPath
output, err := cmd.CombinedOutput()
c.needsSync = false
if err != nil {
// sync --status may exit non-zero if out of sync
outputStr := string(output)
if strings.Contains(outputStr, "out of sync") || strings.Contains(outputStr, "behind") {
c.needsSync = true
return &CheckResult{
Name: c.Name(),
Status: StatusWarning,
Message: "Beads out of sync",
Details: []string{strings.TrimSpace(outputStr)},
FixHint: "Run 'gt doctor --fix' or 'bd sync' to synchronize",
}
}
}
// Note: With Dolt backend, there's no sync status to check.
// Beads changes are persisted immediately.
return &CheckResult{
Name: c.Name(),
Status: StatusOK,
Message: "Beads configured and in sync",
Message: "Beads configured and accessible",
}
}
// Fix runs bd sync if needed.
// Fix is a no-op with Dolt backend (no sync needed).
func (c *BeadsConfigValidCheck) Fix(ctx *CheckContext) error {
if !c.needsSync {
return nil
}
cmd := exec.Command("bd", "sync")
cmd.Dir = c.rigPath
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("bd sync failed: %s", string(output))
}
// With Dolt backend, beads changes are persisted immediately - no sync needed
return nil
}