PersistentPreRunE on adminCmd fires before main.go's PersistentPreRun
sets serverMode/cmdCtx.ServerMode. Cobra runs child PersistentPreRunE
before parent PersistentPreRun, so isEmbeddedMode() sees cmdCtx.ServerMode
as false (zero value) even when metadata.json declares dolt_mode=server.
Fix: remove PersistentPreRunE from adminCmd. Add requireServerMode() helper
and call it at the top of each subcommand's Run func, after store init has
populated cmdCtx.ServerMode correctly.
Fixes: bd admin compact, bd admin cleanup, bd admin reset all returning
'not yet supported in embedded mode' for server-mode projects.
* fix(admin): remove embedded-mode block; cleanup/compact/reset work fine
The admin parent command rejected every invocation in embedded mode with
"'bd admin' is not yet supported in embedded mode", but all three
subcommands (cleanup, compact, reset) only use operations that work in
embedded mode:
- reset: removes files on disk, no store access
- cleanup: uses generic SearchIssues + deleteBatch
- compact: uses CheckEligibility, GetTier{1,2}Candidates, ApplyCompaction
— all implemented on EmbeddedDoltStore
The block was a "skip admin" placeholder added during the embedded-mode-
by-default transition (a35edfd2) and never lifted. Drop it so users on
the default (embedded) backend can run routine Dolt maintenance without
dropping to direct SQL, which bypasses the audit trail.
Closesgastownhall/beads#3313
* fix(dolt): make 'bd dolt show' and 'bd dolt status' embedded-aware
Both commands previously returned "'bd dolt X' is not supported in
embedded mode (no Dolt server)", which is actively misleading: embedded
mode is a first-class Dolt mode (the engine runs in-process), remotes
are configured and used (git+ssh://), and 'bd dolt push' works. The
error made users debugging their sync think no server = nothing synced.
Changes:
- 'bd dolt show': drop the embedded-mode block; showDoltConfig now
prints "Mode: embedded (in-process Dolt engine)" plus the data dir
(.beads/embeddeddolt/), and still lists remotes. Server-only fields
(host/port/user, connection test) are omitted in embedded mode.
- 'bd dolt status': drop the error; report "Dolt engine: embedded
(in-process, no server)" with the data directory. JSON output gets
{"mode":"embedded","running":false,"data_dir":...,"data_dir_exists":...}.
Server-only commands (set, test, start, stop, killall, clean-databases)
remain blocked — they genuinely need a dolt sql-server.
Updates TestDoltShowConfigDefaultMode: after the embedded-by-default
transition, the "default mode" case IS embedded, so the test expectation
of server Host/Port/User output was stale.
Addresses review follow-up on gastownhall/beads#3313.
* test(dolt): update TestEmbeddedDolt for unblocked show/status
Remove "status" and "show" from serverOnlyCmds — they're no longer
server-only after the previous commit. Add embedded_status and
embedded_show positive-case subtests that assert the new embedded-mode
output (must contain "embedded" for status, "Mode:" + "embedded" for
show).
Addresses review feedback from @maphew on #3330.
* Clarify embedded dolt status JSON
---------
Co-authored-by: matt wilkie <maphew@gmail.com>
The 'bd clean' command was previously consolidated into 'bd doctor --fix',
but the cleanup help text still referenced it. Updated to point users to
the correct commands and improved example formatting.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/polecats/jasper
Rig: beads
Role: polecats
Move cleanup, compact, and reset commands under `bd admin` namespace.
Creates hidden aliases for backwards compatibility that show deprecation
notice when used.
- Create cmd/bd/admin.go with parent command
- Create cmd/bd/admin_aliases.go for hidden backwards-compat aliases
- Update cleanup.go, compact.go, reset.go to remove rootCmd.AddCommand
- Update all documentation to use `bd admin <cmd>` syntax
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>