fix(daemon): allow read-only daemon commands with Dolt backend

The daemon guard was blocking ALL daemon commands when using Dolt
backend, including read-only commands like `status`, `stop`, `logs`.

Changes:
- Rename guard to `guardDaemonStartForDolt` (more accurate)
- Remove `PersistentPreRunE` from `daemonCmd` and `daemonsCmd`
- Add `PreRunE` guard only to `daemonStartCmd` and `daemonsRestartCmd`
- Update test to use new function name and test start command

Now:
- `bd daemon status` works with Dolt backend
- `bd daemon start` blocked unless `--federation` flag
- `bd daemon start --federation` works (starts dolt sql-server)

Fixes: bd-n7o47

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beads/crew/emma
2026-01-21 18:05:53 -08:00
committed by Steve Yegge
parent 4e3e9d1441
commit bb4549abdd
5 changed files with 17 additions and 11 deletions

View File

@@ -35,6 +35,7 @@ Examples:
bd daemon start --foreground # Run in foreground (for systemd/supervisord)
bd daemon start --local # Local-only mode (no git sync)
bd daemon start --federation # Enable federation mode (dolt sql-server)`,
PreRunE: guardDaemonStartForDolt,
Run: func(cmd *cobra.Command, args []string) {
interval, _ := cmd.Flags().GetDuration("interval")
autoCommit, _ := cmd.Flags().GetBool("auto-commit")