Repository navigation
fix(hush): --value never reads stdin, and hyphen values reach bws intact - #101
Conversation
…es to bws intact add evaluated stdin_value() eagerly through Option::or, so --value still read stdin to EOF and hung on an open ssh connection. bws 2.1.0 parses a hyphen-leading positional or split --opt value as a flag and exits 2. create and edit now put options in --opt=value form and positionals after --, with -o json first. add and edit --value take hyphen-leading values.
…ndary tests allow_hyphen_values let --value take a following flag as the secret, so --value --stdin stored the text --stdin. Hyphen values go in as --value=... or on stdin, which already parsed. The boundary tests now assert the exact bws argv and never pass a real token to bws.
Architecture Data flow Review ✨ Nothing flagged · reviewed Tip Open a diagram on the canvas, then press W or click play to walk through the change one step at a time 🪧 More tips
Thanks for using PR Lens! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out on X, Bluesky, Mastodon, Reddit or LinkedIn |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 1
Please check the settings in the CodeRabbit UI or the
|
|
Spec fidelity against the brief (two hush defects, plus edit and other value paths):
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: Reviewed all three changed files, the shared CLI/TUI callers, and the upstream bws 2.1.0 argument contract.
- Lazy stdin fallback:
hush addno longer reads stdin when--valueis supplied; existing stdin fallback behavior is preserved. - Literal argument forwarding: Create positionals follow
--, edit options use--name=value, and global JSON output precedes subcommands so hyphen-leading fields reachbwsintact. - Boundary regressions: Five subprocess tests cover held-open stdin, exact create/edit argv, multiline PEM input, and rejection of
--value --stdinwithout a write.
Validation passed: 27 unit tests, five boundary tests, formatting, and Clippy with warnings denied. Live BWS writes were not repeated in this review. The separate PR-body check fails on the maintenance base checkout with Module not found ".claude/skills/open-pr/check.ts"; that failure is outside this Rust diff.
gpt-6.1-sol | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: Reviewed the delta from d60056d to 89ced3e, with the full PR diff as context.
- Added piped-stdin add coverage: The new subprocess test omits
--value, supplies a multiline PEM on stdin, closes the pipe, and verifies the exactbws secret createargv, including the trailing newline. Production code is unchanged.
Validation passed: 27 unit tests, six boundary tests, Rust formatting, and Clippy with warnings denied. Live BWS writes were not repeated. The unrelated PR-body check still fails on the maintenance-base checkout with Module not found ".claude/skills/open-pr/check.ts", as in the previous review.
gpt-6.1-sol | 𝕏
|
Spec fidelity at a78a56a: no deviations. The Problem names two defects. hush add --value hung on an open stdin, and hyphen-leading values failed in hush add, hush edit, and the TUI. The diff fixes both in bws.rs and commands.rs, and the real-BWS transcript in Proof shows each case. a78a56a only merges hush/0.0.x (PR #108, the PR body checker) into this branch. The PR diff against the base is byte-identical to the reviewed 89ced3e diff. |

Problem
Every fleet box runs a pre-broker hush build that calls
bwsdirectly.hush add --valuestill reads stdin to end of file, so it hangs while stdin is an open ssh connection. An agent waited 9 minutes on it. A value that starts with-, such as a PEM block, fails withbws secret create failed (exit status: 2)inhush add,hush edit, and the TUI.Change
This PR targets the new maintenance branch
hush/0.0.x, cut at1e92b9b. Main removed this code in #84, so the fix cannot land there.tests/bws_boundary.rsruns the builthushagainst a stubbwson PATH. The stub applies the bws 2.1.0 rule: a hyphen-leading token before--must be a known option. Hyphen values go to hush as--value=...or on stdin.Proof
Real BWS on aojdevlinux, over ssh, with stdin held open by a FIFO. The before binary is the installed
~/.cargo/bin/hush(e269d59). The after binary is a release build of this branch. Each test secret uses theHUSH_TEST_prefix, and the script deletes them all.1e92b9bsrc, new tests)hush did not exit within 10sbws secret create failed (exit status: 2)bws secret edit failed (exit status: 2)bws secret edit failed (exit status: 2)bun run check(fmt, 27 unit and 6 boundary tests, clippy -D warnings)89ced3eThe bws 2.1.0 parser rule was checked live with no token set.
bws secret create K -----BEGIN-x <uuid>exits 2.bws -o json secret create --note=-n -- -K -----BEGIN-x <uuid>reaches "Missing access token".Review
Interrogate panel on
1e92b9b...4294be3: Opus 5.5, Sonnet 5.5, GPT-6.1 Sol. Muse Wonder Full failed with a quota 429. Round 2 on the fix diff: GPT-6.1 Sol. A late Muse Spark pass asked for a piped stdin add test. Round 3 on that test: Grok 4.7, no findings.allow_hyphen_valueslet--valueswallow the next flag, so--value --stdinstored--stdin(Opus, Sonnet)value_never_takes_the_next_flag_as_the_secret.BWS_ACCESS_TOKENto any bws that shadows the stub (Opus)env_removeforBWS_ACCESS_TOKENandBWS_SERVER_URL.--key=-HUSH_TEST_KEY.operation_nametest used the old edit argv shape (Opus)--value=super-secret -- secret-id.format!("--value=...")may free an unzeroed copy (Opus, Sonnet)psshows, asbws-tui/src/bws.rs:65states.--noteand--keyreject split hyphen values in the hush parser (Sonnet)=form works, asedit_sends_hyphen_leading_key_and_note_to_bws_intactproves.hush addwith piped stdin and no--value(Muse Spark)add_without_value_reads_piped_stdin.list,get, anddeletepass a positional without--(Muse Wonder Full)bws-tui/src/bws.rs:49,56,93show. A UUID never starts with-.--projecton a terminal,addreads the project pick from stdin even with--value(Muse Wonder Full)bws-tui/src/commands.rs:194.ETXTBSYrace when the stub is executed (Sonnet)PR body contractcheck failed withModule not foundbecausehush/0.0.xhad no checkerhush/0.0.x, merged asa4ba7b1.Merge danger
Door: two-way. Revert this PR to undo it. Merging changes no installed binary.
Blast radius: low. Only
bws::create_secret,bws::edit_secret, andrunchange. Their callers arehush add,hush edit, and the TUI, and real BWS proves each one works.Changes made by Claude Opus 5.5 via Claude Code