fix(cli): honor no-passphrase before prompts - #87
Conversation
GPT ReviewerVerdict: REJECT Reviewed head The precedence fix appears correct in the helpers, but the required real CLI-path regression coverage is missing. Findings
Shared exact-snapshot validation
|
Claude ReviewerVerdict: REJECT Reviewed head The fix itself is correct: both signWithWalletPassphrase and createPassphrase now resolve --no-passphrase before any promptBarePassphrase() path, so the contradictory forms (--no-passphrase with bare or valued --passphrase) yield passphrase-less behavior without a TTY prompt or non-TTY error, while bare --passphrase alone still prompts and valued --passphrase still passes through; the protected-wallet error ladder and JSON/stdout contracts are unchanged, and typecheck/lint/tests/build/pack validation all pass. However, the new contradictory-flag behavior is validated only via synthetic helper-unit flag objects (args({ "no-passphrase": true, passphrase: true })), not through the real parseArgs → assertKnownFlags → command path. The bundle's mandatory invariants explicitly require validating through that real path, and the test file's own cli#29 regression block exists precisely because passphrase flag behavior must survive real parsing, not just direct unit calls. Whether parseArgs actually yields { "no-passphrase": true, passphrase: true } for the real argv — in either flag order (e.g. --passphrase --no-passphrase could conceivably consume the next token as a value) — is unverified by any test, leaving the headline fix unguarded at the layer where the bug class lives. One minor actionable finding; everything else is clean. Findings
Shared exact-snapshot validation
|
Summary
--no-passphraseconsistently win over both bare and valued--passphraseValidation
npm run test -w @h402/cli -- tests/passphrase.test.ts— 14/14 passednpm test— CLI 214/214 and core 14/14 passednpm run typechecknpm run lintnpm run buildnpm run verify:packnpm run smoke:packgit diff --cached --checkCloses #84