Stop vault creation when a vault's metadata cannot be read #172

Merged
clawbot merged 1 commits from fix/140-corrupt-metadata-index into next 2026-10-15 06:02:23 +02:00
1 Commits
Author SHA1 Message Date
sneak 41965aa810 Stop vault creation when a vault's metadata cannot be read (closes #140)
check / check (push) Waiting to run
GetNextDerivationIndex passed over a vault whose vault-metadata.json could
not be read or parsed, so the next vault made from the same mnemonic could
get that vault's derivation index and so the same long-term key. It now
returns an error naming the file, so vault create and init stop with that
error and leave the state directory as it was. A vault directory with no
metadata file is still skipped.

The regression test breaks one vault's metadata, once with content that
does not parse and once with a test filesystem that fails to open it, and
requires CreateVault with the same mnemonic to fail, naming the file, and
leave no new vault.

Model: opus-5-5
2026-10-15 03:32:28 +00:00