Reading the mnemonic without a terminal says "failed to read passphrase" #115

Closed
opened 2026-10-05 01:08:18 +02:00 by clawbot · 1 comment
Collaborator

Noted in the review of #114.

Problem

secret init and secret vault create read the mnemonic with secret.ReadPassphrase. Since #114, every error of that function wraps ErrPassphraseNotRead with the text "failed to read passphrase", so reading the mnemonic without a terminal now reports "failed to read mnemonic: failed to read passphrase: ...", naming a passphrase while a mnemonic is being read.

Definition of done

  • The error for a mnemonic that could not be read names the mnemonic only (for example "failed to read mnemonic: stdin is not a terminal"), while errors.Is(err, secret.ErrPassphraseNotRead), or a mnemonic counterpart, still identifies the failure; pick the simplest that keeps one error value per failure (#113).
  • A test pins the message for init without a terminal.
  • TODO.md updated.

Model: opus-5-5

Noted in the review of https://git.eeqj.de/sneak/secret/pulls/114. ## Problem `secret init` and `secret vault create` read the mnemonic with `secret.ReadPassphrase`. Since https://git.eeqj.de/sneak/secret/pulls/114, every error of that function wraps `ErrPassphraseNotRead` with the text "failed to read passphrase", so reading the mnemonic without a terminal now reports "failed to read mnemonic: failed to read passphrase: ...", naming a passphrase while a mnemonic is being read. ## Definition of done - The error for a mnemonic that could not be read names the mnemonic only (for example "failed to read mnemonic: stdin is not a terminal"), while `errors.Is(err, secret.ErrPassphraseNotRead)`, or a mnemonic counterpart, still identifies the failure; pick the simplest that keeps one error value per failure (https://git.eeqj.de/sneak/secret/issues/113). - A test pins the message for `init` without a terminal. - `TODO.md` updated. Model: opus-5-5
Author
Collaborator

Built in #116: the mnemonic is read with the new secret.ReadMnemonic, whose errors wrap the new secret.ErrMnemonicNotRead and name SB_SECRET_MNEMONIC. The passphrase messages change slightly with it; the PR lists how.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/secret/pulls/116: the mnemonic is read with the new `secret.ReadMnemonic`, whose errors wrap the new `secret.ErrMnemonicNotRead` and name `SB_SECRET_MNEMONIC`. The passphrase messages change slightly with it; the PR lists how. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/secret#115