Add remaining multi-repo files from bd-307

This commit is contained in:
Steve Yegge
2025-11-04 16:33:09 -08:00
parent 67710e4a0c
commit fc0223854c
4 changed files with 340 additions and 0 deletions

View File

@@ -271,6 +271,18 @@ func runDaemonLoop(interval time.Duration, autoCommit, autoPush bool, logPath, p
defer func() { _ = store.Close() }()
log.log("Database opened: %s", daemonDBPath)
// Hydrate from multi-repo if configured
hydrateCtx := context.Background()
if results, err := store.HydrateFromMultiRepo(hydrateCtx); err != nil {
log.log("Error: multi-repo hydration failed: %v", err)
os.Exit(1)
} else if results != nil {
log.log("Multi-repo hydration complete:")
for repo, count := range results {
log.log(" %s: %d issues", repo, count)
}
}
// Validate database fingerprint
if err := validateDatabaseFingerprint(store, &log); err != nil {
if os.Getenv("BEADS_IGNORE_REPO_MISMATCH") != "1" {

View File

@@ -596,6 +596,14 @@ func createConfigYaml(beadsDir string, noDbMode bool) error {
# Debounce interval for auto-flush (can also use BEADS_FLUSH_DEBOUNCE)
# flush-debounce: "5s"
# Multi-repo configuration (experimental - bd-307)
# Allows hydrating from multiple repositories and routing writes to the correct JSONL
# repos:
# primary: "." # Primary repo (where this database lives)
# additional: # Additional repos to hydrate from (read-only)
# - ~/beads-planning # Personal planning repo
# - ~/work-planning # Work planning repo
# Integration settings (access with 'bd config get/set')
# These are stored in the database, not in this file:
# - jira.url