4 Commits

Author SHA1 Message Date
gastown/crew/joe
ca51980ffc fix(dolt): recognize shim hooks as Dolt-compatible
Shim hooks (bd-shim marker) delegate to 'bd hook' command which already
handles Dolt backend correctly. Update both doctor check and migration
warning to recognize shim hooks as OK.

Only inline hooks (older style with embedded logic) need the explicit
Dolt backend check in the shell script.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 12:04:06 -08:00
gastown/crew/joe
a93c32b425 fix(dolt): add hook compatibility check and migration warning
Two improvements for Dolt backend users with stale git hooks:

1. Migration warning: When running 'bd migrate --to-dolt', warn if
   installed hooks lack the Dolt backend check and suggest reinstalling.

2. Doctor check: New CheckGitHooksDoltCompatibility() detects when
   hooks exist but lack the Dolt skip logic, surfacing the error with
   a clear fix message.

Both changes help users who migrated to Dolt but have pre-migration
hooks that try to run JSONL sync (which fails with Dolt backend).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 11:54:30 -08:00
beads/crew/jane
97d4b174d0 fix(migrate): address code review issues in Dolt migration
Fixes from code review:

1. **Data completeness**: Now migrates events (including comments)
   and all config values, not just issues/labels/deps

2. **formatJSONArray**: Fixed to use JSON encoding for waiters field
   to match Dolt schema (was using comma-separated format)

3. **Cleanup on failure**: Removes partial Dolt directory or SQLite
   files if import fails mid-way

4. **Progress indicator**: Shows "Importing issues: N/M" for large
   migrations (100+ issues)

5. **Code deduplication**: Extracted common logic into:
   - migrationData struct
   - storageReader interface
   - extractFromStore() shared extraction
   - Helper functions for output formatting

6. **Improved dry-run output**: Now shows event count and config
   key count in migration plan

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 19:27:01 -08:00
beads/crew/jane
4e3e9d1441 feat(migrate): add SQLite to Dolt migration tooling (hq-ew1mbr.6)
Add `bd migrate --to-dolt` and `bd migrate --to-sqlite` commands for
migrating between SQLite and Dolt storage backends.

Features:
- `--to-dolt`: Migrate from SQLite to Dolt backend
  - Creates backup of SQLite database before migration
  - Imports all issues, labels, and dependencies
  - Updates metadata.json to use Dolt backend
  - Preserves JSONL export configuration

- `--to-sqlite`: Escape hatch to migrate back to SQLite
  - Exports all data from Dolt to new SQLite database
  - Updates metadata.json to use SQLite backend

Both commands support:
- `--dry-run` flag to preview changes
- `--yes` flag for automated/scripted usage
- `--json` flag for machine-readable output
- Non-cgo stub for builds without CGO support

This implements Part 7 (Migration Tooling) of DOLT-STORAGE-DESIGN.md.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 17:46:15 -08:00