Observed (init not idempotent against partial leftovers)
During a store recreate, after manually clearing the dodder store, der init -blob_store-id default etsy failed in sequence on residual files, each requiring a separate manual rm -rf:
~/.local/share/madder/blob_stores/default/blob_store-config: file exists — plain der init etsy with no -blob_store-id tried to create the default store config that already existed → CreateExclusiveWriteOnly failure.
~/.local/share/dodder/inventory_lists_log: file exists
~/.config/dodder/config-mutable already exists, not overwriting → invalid argument
Only after rm -rf ~/.local/share/dodder and rm -rf ~/.config/dodder did init succeed.
Requirements / fixes
- deinit MUST NOT touch the madder blob store at all. The madder default store (
~/.local/share/madder/blob_stores/default) holds blob bodies that must survive a dodder repo recreate. Verify deinit's GetXDGPaths() (internal/uniform/commands_dodder/deinit.go:90) does not include the madder namespace — it lives in a sibling ~/.local/share/madder/ dir, so it likely already is excluded — confirm and add a regression test pinning that deinit leaves the madder store intact.
der init with no -blob_store-id should gracefully reuse a pre-existing default blob-store config instead of failing with blob_store-config: file exists. writeBlobStoreConfigIfNecessary already early-returns when the path exists (internal/foxtrot/env_repo/genesis.go:187-196) for the default path — but the plain init etsy path still errored, so the exclusive-create is happening somewhere else. Trace and make it idempotent/skip-if-exists.
- init should fail cleanly OR be idempotent against leftover dodder XDG files (
inventory_lists_log, config-mutable). Right now a partially-present store yields cryptic per-file file exists / invalid argument errors across multiple runs. Either (a) detect an existing repo and refuse with one clear "repo already initialized, run deinit first" message, or (b) make init idempotent.
Context
Surfaced while recreating a v14 store to work around the tommy-strict konfig decode bug (#259). The recreate flow was: rm dodder store (keep madder), init -blob_store-id default, import full-history export.
Verify
BATS in the nix sandbox (deterministic): partial-leftover init scenarios + a deinit-preserves-madder-store assertion.
:clown: filed by Clown (0.4.0+cd38c2d) — built from cd38c2d
Observed (init not idempotent against partial leftovers)
During a store recreate, after manually clearing the dodder store,
der init -blob_store-id default etsyfailed in sequence on residual files, each requiring a separate manualrm -rf:~/.local/share/madder/blob_stores/default/blob_store-config: file exists— plainder init etsywith no-blob_store-idtried to create the default store config that already existed →CreateExclusiveWriteOnlyfailure.~/.local/share/dodder/inventory_lists_log: file exists~/.config/dodder/config-mutable already exists, not overwriting→invalid argumentOnly after
rm -rf ~/.local/share/dodderandrm -rf ~/.config/dodderdid init succeed.Requirements / fixes
~/.local/share/madder/blob_stores/default) holds blob bodies that must survive a dodder repo recreate. Verifydeinit'sGetXDGPaths()(internal/uniform/commands_dodder/deinit.go:90) does not include the madder namespace — it lives in a sibling~/.local/share/madder/dir, so it likely already is excluded — confirm and add a regression test pinning that deinit leaves the madder store intact.der initwith no-blob_store-idshould gracefully reuse a pre-existing default blob-store config instead of failing withblob_store-config: file exists.writeBlobStoreConfigIfNecessaryalready early-returns when the path exists (internal/foxtrot/env_repo/genesis.go:187-196) for the default path — but the plaininit etsypath still errored, so the exclusive-create is happening somewhere else. Trace and make it idempotent/skip-if-exists.inventory_lists_log,config-mutable). Right now a partially-present store yields cryptic per-filefile exists/invalid argumenterrors across multiple runs. Either (a) detect an existing repo and refuse with one clear "repo already initialized, run deinit first" message, or (b) make init idempotent.Context
Surfaced while recreating a v14 store to work around the tommy-strict konfig decode bug (#259). The recreate flow was: rm dodder store (keep madder),
init -blob_store-id default, import full-history export.Verify
BATS in the nix sandbox (deterministic): partial-leftover init scenarios + a deinit-preserves-madder-store assertion.
:clown: filed by Clown (0.4.0+cd38c2d) — built from cd38c2d