Commit graph

8 commits

Author SHA1 Message Date
Medhat Galal
57ddb0bbfe
fix: bd admin commands fail with 'embedded mode' error in server mode (#3438)
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.
2026-04-28 06:33:03 -07:00
Leon Letto
86d5511b33
fix(admin,dolt): allow admin + dolt show/status in embedded mode (#3330)
* 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.

Closes gastownhall/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>
2026-04-24 06:12:17 -07:00
coffeegoddd☕️✨
a35edfd28e /{internal,cmd,.goreleaser,.github}: embedded mode by default 2026-03-28 13:47:20 -07:00
coffeegoddd☕️✨
ce80b08730 /cmd/bd: pr feedback 2026-03-25 15:36:27 -07:00
coffeegoddd☕️✨
a49f32ad8b /cmd/bd: skip admin, update repo 2026-03-25 15:27:54 -07:00
beads/crew/emma
7eed8b8a1e refactor: remove tombstone/soft-delete system (Phase 4)
Remove the tombstone soft-delete mechanism across the codebase. Dolt handles
delete propagation natively, making tombstones obsolete.

Key changes:
- Remove StatusTombstone constant and all status checks
- Remove DeletedAt/DeletedBy/DeleteReason/OriginalType fields from Issue struct
- Remove resurrection mechanism (JSONL parent recovery), replace with existence checks
- Simplify schema CHECK constraint (2 clauses instead of 3)
- Remove compact_tombstone.go, resurrection.go, migrate_tombstones.go
- Remove tombstone-specific tests (resurrection, expired tombstones, migration)
- Update doctor/fix validation to skip tombstone-specific checks
- Preserve migration files for backward compatibility with existing databases
- 104 files changed, 6117 deletions, 422 insertions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-14 21:22:24 -08:00
jasper
bc19c0241b docs: update cleanup help text, remove stale bd clean reference (bd-au0.8)
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
2026-02-10 12:11:36 -08:00
Steve Yegge
d77a697cee feat: add bd admin parent command for cleanup/compact/reset (bd-3u8m)
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>
2025-12-27 16:21:08 -08:00