Correct behaviour. Check, under the lock, that the vault does not exist before any prompt, and print "Initialized" only on success.
Definition of done
init and vault create on an existing vault fail without prompting.
A test runs init on an existing vault with no terminal and no environment variables; before the fix the error is about reading the mnemonic, after it the error says the vault exists.
Model: fable-5-1
Severity: minor. The user types the mnemonic and a passphrase twice for nothing; the refusal itself is right and nothing is written.
```
secret init # the default vault exists
Initialized secrets manager at: /home/u/.config/berlin.sneak.pkg.secret
Enter your BIP39 mnemonic phrase:
Enter passphrase for unlocker:
Confirm passphrase:
Error: failed to create default vault: vault default already exists
```
"Initialized" is printed before the refusal too. `secret vault create default` behaves the same way.
**Where.** https://git.eeqj.de/sneak/secret/src/commit/ef0ae90768c8b18a829033b3ebd4cf98fcaeb3d1/internal/cli/init.go#L103 prompts and https://git.eeqj.de/sneak/secret/src/commit/ef0ae90768c8b18a829033b3ebd4cf98fcaeb3d1/internal/cli/init.go#L139 creates; https://git.eeqj.de/sneak/secret/src/commit/ef0ae90768c8b18a829033b3ebd4cf98fcaeb3d1/internal/cli/vault.go#L268 and https://git.eeqj.de/sneak/secret/src/commit/ef0ae90768c8b18a829033b3ebd4cf98fcaeb3d1/internal/cli/vault.go#L296; the existence check is inside `CreateVault` at https://git.eeqj.de/sneak/secret/src/commit/ef0ae90768c8b18a829033b3ebd4cf98fcaeb3d1/internal/vault/management.go#L247.
**Correct behaviour.** Check, under the lock, that the vault does not exist before any prompt, and print "Initialized" only on success.
**Definition of done**
- `init` and `vault create` on an existing vault fail without prompting.
- A test runs `init` on an existing vault with no terminal and no environment variables; before the fix the error is about reading the mnemonic, after it the error says the vault exists.
Model: fable-5-1
sneak
was assigned by clawbot2026-10-13 00:31:00 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Severity: minor. The user types the mnemonic and a passphrase twice for nothing; the refusal itself is right and nothing is written.
"Initialized" is printed before the refusal too.
secret vault create defaultbehaves the same way.Where.
CreateVaultatCorrect behaviour. Check, under the lock, that the vault does not exist before any prompt, and print "Initialized" only on success.
Definition of done
initandvault createon an existing vault fail without prompting.initon an existing vault with no terminal and no environment variables; before the fix the error is about reading the mnemonic, after it the error says the vault exists.Model: fable-5-1