Skip to content

fix(beads): use Bash escapes for recovery command controls (FUZZ-040 r2) - #719

Merged
randlee merged 1 commit into
integrate/phase-tfrom
fix/t-7-fuzz-040-r2-bash-escapes
Oct 8, 2026
Merged

randlee merged 1 commit into
integrate/phase-tfrom
fix/t-7-fuzz-040-r2-bash-escapes

Conversation

@randlee

@randlee randlee commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Fixes comp-t-7.fuzz-040-r2-fix (round 2 of FUZZ-040, filed by comp-t-7.15-qa): recovery-command shell quoting uses bash $'...' with fixed-width \xHH / \uHHHH / \UHHHHHHHH escapes for control and bidi format characters (U+202A-202E, U+2066-2069, U+200E/F), never Rust escape_default. Regression tests cover the library and CLI paths with a bash round-trip.

Rebased 5e99ce0 -> fe1e05b onto #718. Gates at fe1e05b: clippy -D warnings clean, fmt clean, cargo test --workspace 1067 passed / 0 failed / 0 ignored.

🤖 Generated with Claude Code

@randlee
randlee added this pull request to stack #625 October 7, 2026 22:17
@randlee
randlee force-pushed the fix/t-7-fuzz-040-r2-bash-escapes branch from 5e99ce0 to fe1e05b Compare October 7, 2026 22:18
@randlee

randlee commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

QA fix verification: comp-t-7.fuzz-040-r2-qa (FUZZ-040, round 2) at fe1e05b

Verdict: PASS on the carried finding's own criteria. Two follow-up observations are reported, not held against the fix.

Finding Disposition
fuzz-040 fixed (see judgement note)

Verified by the fuzz coordinator at the pinned commit:

  • ASCII control characters (BEL, ESC, newline, tab, DEL, 0x01, 0x1F) print as $'\xHH'; U+0085 and the bidi characters U+202A-202E, U+2066-2069, U+200E/F print as $'\uHHHH'. No raw bidi or control character appears in the output, and all of them round-trip byte for byte under bash 5.3 (bash -c 'printf %s <arg>'); the control characters also under macOS /bin/bash 3.2.
  • Single quote, backslash, $(id)58, semicolon, spaces, an accented letter, an emoji and literal \x41 / ‮ text all round-trip. A plain id prints as 'spc-1', the round-1 form.
  • The regression test now drives BeadComposeError::GraphEdgeMissing and missing_edge_recovery_commands with a hostile id (control character and U+202E), asserts no raw control or listed bidi character, and does a dynamic bash round-trip. It is un-ignored, passes, and fails at the round-1 commit 1f37cde (old \u{7} form). cargo test -p sc-compose passes.
  • Local fmt, clippy -D warnings and tests are clean at this head.

Judgement note. The coordinator returned open. I closed it fixed because its two remaining defects lie outside the finding's own wording ("every printed argument shell-quoted, control characters escaped", bidi named in the observation); they came from characters I added to the verifier's check list, not from the carried finding. Team-lead can reopen. Observations, for a follow-up bead if wanted:

  • fuzz-040-r2-a: needs_shell_escape covers is_control plus a hand-picked bidi list, so other format and line-separator characters (U+2028, U+2029, U+FEFF, U+200B, U+200D, U+2060, U+00AD, U+061C, U+E0001) are still printed raw inside the quotes. Round-trip is exact, but they are raw in the terminal. Suggest escaping all Unicode Cf plus U+2028/2029.
  • fuzz-040-r2-b: \uHHHH is not valid in macOS /bin/bash 3.2, so the escaped bidi characters and U+0085 print as literal text there (zsh and bash 4.2+ are fine). Encoding as \xHH UTF-8 bytes would work everywhere. The test runs whichever bash is first on PATH.

Disclosures: no real bd. The CLI human text path was checked through the bead.rs unit test, not by running bead preview-attach or attach, and --json receipt output was not compared byte for byte (the code gates the new diagnostics on !json, and shell_quote is not on the JSON path). The human refusal message line of the FUZZ-039 layer below, which can print raw control/bidi characters from an id, was not examined here. CI not checked (rate-limit rule). Hand-locked: fix-round-scope accepted the coordinator for fuzz-040.

@randlee
randlee force-pushed the fix/t-7-fuzz-040-r2-bash-escapes branch from fe1e05b to f774cbb Compare October 8, 2026 00:25
@randlee
randlee removed this pull request from stack #625 October 8, 2026 00:45
@randlee
randlee added this pull request to stack #739 October 8, 2026 01:15
Base automatically changed from fix/t-7-fuzz-039-r2-human-receipt-fields to integrate/phase-t October 8, 2026 01:16
@randlee
randlee force-pushed the fix/t-7-fuzz-040-r2-bash-escapes branch from f774cbb to 3903505 Compare October 8, 2026 01:16
@randlee
randlee merged commit df9b0e1 into integrate/phase-t Oct 8, 2026
11 of 13 checks passed
@randlee
randlee deleted the fix/t-7-fuzz-040-r2-bash-escapes branch October 8, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant