Repository navigation
fix(output): shell-quote ids and paths in first-action and test-oracle proof commands - #5269
Conversation
The review-comments first-action command and the test-oracle assistant proof handoff commands interpolated the root, ledger path, snapshot paths and seam id raw. Seam ids embed file paths, so a space, apostrophe or semicolon split or ran the pasted command. Use shell_arg like the other printed commands. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVLYAKjmToB1PDDGR6u1Hk
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Limit details: You’ve used all 10 included reviews currently available. Summary by CodeRabbit
WalkthroughGenerated first-action, verification, and agent-start commands now shell-quote root paths, ledger and snapshot paths, and seam IDs. Regression tests check command rendering with spaces, apostrophes, and shell metacharacters. ChangesGenerated Command Quoting
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable issue remains in the changed generated commands; the PR is mergeable after normal checks. Architecture SummaryArchitecture risk: 🟡 Medium · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
Reliability and maintainability
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
A rabbit checks each quoted trail, Comment |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm tests rely on single-quote + escaped-apostrophe form; PowerShell cannot paste these as one argument.
- Confirm collect_strings flattens JSON to every string field; assert uses .any() so duplicate strings pass.
- Confirm sensor evidence asymmetry: ripr sensor failed with exit code 2, cargo-check/cargo-clippy/cargo-fmt/cargo-test are skipped or late; the only executable proof is the two new unit tests plus author-reported precommit. PR claim is small and well-scoped but no green build receipt is in the packet.
Refuted
- Empty
--rootcould now serialize as an empty argument and break the downstream CLI.; refuted because: All changed sites pass values that are non-empty by construction (display_path of a real root, required gap_ledger_path, agent_root returning a string, before/after from snapshot paths, seam.seam_id from the seam). No new empty-arg surface introduced.
Parked follow-ups
- Only one of the two new tests uses an existing fixture parser; the other hand-builds inputs. The collect_strings helper walks the JSON tree but only checks that the literal strings appear somewhere, not their location. Minor brittleness if other command strings are added later.
- repair_card_handoff.rs is intentionally not touched because #5247 is rewriting those lines; this is an explicit out-of-scope declaration in the PR body and matches the linked disjoint-stack claim.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
…acOS and Windows (#5296) * fix(first-pr): quote root and refs in preflight recovery commands The missing-head, no-diff and diff-error preflight recovery commands and the stale-packet, missing-base messages interpolated the root, base, head and branch raw. A root with spaces or non-ASCII characters split argv, and a ref like topic;touch x injected a command. Route them through shell_arg and command_root like the sibling builders, and add a foreign-cwd regression test that runs each emitted rerun command against a decoy checkout. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0158DzWQfwtytj3uRvMxNmnY * fix(first-pr): end git options before the fetched branch in the missing-base hint A base such as origin/--upload-pack=CMD stays one quoted argument but git still reads it as an option, so pasting the hint ran CMD. Render git fetch origin -- BRANCH and execute the fetch half in the regression test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0158DzWQfwtytj3uRvMxNmnY * test(first-pr): satisfy clippy in recovery quoting test Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0158DzWQfwtytj3uRvMxNmnY * fix(output): double typographic quotes in PowerShell command forms Before: `shell_arg` leaves U+2018-U+201B untouched inside its single-quoted span, and `powershell_command` passed them through. PowerShell reads those characters as single quotes, so a root or ref such as `Steven’s repo` closed the literal early: the pasted line failed to parse, and a crafted name like `x’; calc; ‘y` ran a command. Every surface printed "runs unchanged in PowerShell" for such a path. The plain-text `check` drill-in and the `explain` next-step also printed only the bash `'\''` form, which PowerShell rejects for any apostrophe path. After: the translation doubles each typographic single quote inside a literal (PowerShell reads a doubled pair as the same character) and withholds a typographic double quote inside a double-quoted span. The `check` drill-in and `explain` follow-up print a `(PowerShell)` line when the shared translation differs, and nothing extra otherwise. Tests: pure string pins, plus a real-pwsh run that binds apostrophe, space, non-ASCII, each typographic quote and an injection payload as one argv entry, with an untranslated control that proves the harness sees the injection. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVLYAKjmToB1PDDGR6u1Hk * test(output): assert the full PowerShell argv vector in the hostile-path proof Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVLYAKjmToB1PDDGR6u1Hk * test(first-pr): expect option-terminated fetch in preflight base test Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0158DzWQfwtytj3uRvMxNmnY * test(evidence): build the import-line fixture through the fact arenas #5062 added retained_import_lines_preserve_unbounded_affinity_and_owner_matching, which constructs RustIndex from its public tests/functions/files fields. #5109 made those fields generation-owned arenas behind accessors. Each PR was green on its own base; together, main's ripr lib tests no longer compile (E0560/E0615/E0616 at related_tests/context.rs:578-595). Build the fixture with extend_tests/extend_functions plus insert_file_only, which keeps the flat facts as occurrences separate from the file copy, as the original fixture had, and rewrite the flat test through test_at_mut. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y (cherry picked from commit e7547c8) * test(evidence): build the import-line fixture through the fact arenas #5062 added retained_import_lines_preserve_unbounded_affinity_and_owner_matching, which constructs RustIndex from its public tests/functions/files fields. #5109 made those fields generation-owned arenas behind accessors. Each PR was green on its own base; together, main's ripr lib tests no longer compile (E0560/E0615/E0616 at related_tests/context.rs:578-595). Build the fixture with extend_tests/extend_functions plus insert_file_only, which keeps the flat facts as occurrences separate from the file copy, as the original fixture had, and rewrite the flat test through test_at_mut. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y * test(evidence): build the import-line fixture through the fact arenas #5062 added retained_import_lines_preserve_unbounded_affinity_and_owner_matching, which constructs RustIndex from its public tests/functions/files fields. #5109 made those fields generation-owned arenas behind accessors. Each PR was green on its own base; together, main's ripr lib tests no longer compile (E0560/E0615/E0616 at related_tests/context.rs:578-595). Build the fixture with extend_tests/extend_functions plus insert_file_only, which keeps the flat facts as occurrences separate from the file copy, as the original fixture had, and rewrite the flat test through test_at_mut. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5D7B2JxJ754s1p6ktir1Y * fix(agent): bind the selected root in printed card and repair commands `ripr agent card` and the agent repair/receipt recovery messages printed commands that only worked from the directory the user ran ripr in: a relative `--root .` was echoed verbatim, and the card's `full packet:` line and identity refusal omitted `--root` entirely. Commands displayed to a CLI user now bind the root with `bound_root`, the rule `first-pr`, `pilot` and `agent status` already use. The binding is lexical, so the #4332 intent holds: refusals still never print the canonicalized verbatim store path. The card's typed command args, detail routes and the LSP/MCP projections stay portable, and display never enters card identity. Refs #3999 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017EDabHFEFLYLzhb7eX34cD * fix(agent): quote finding and seam ids in repair-card detail routes Finding ids embed the raw file path, so a file such as `it's;x.rs` put a space, apostrophe and `;` into the card's `ripr explain` route; pasted, it split or ran the tail as a second command. The explain, canonical-packet and identity-refusal routes now quote the id with `shell_arg`. Ordinary ids stay byte-identical, and route text never enters card identity. Refs #3999 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017EDabHFEFLYLzhb7eX34cD * Quote the finding id in the witness explain_command Finding ids embed the raw file path, so a path with a space, apostrophe or semicolon split or ran the tail of the pasted command. Use shell_arg, the same quoting the other printed commands use. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVLYAKjmToB1PDDGR6u1Hk * Quote ids and paths in first-action and test-oracle proof commands The review-comments first-action command and the test-oracle assistant proof handoff commands interpolated the root, ledger path, snapshot paths and seam id raw. Seam ids embed file paths, so a space, apostrophe or semicolon split or ran the pasted command. Use shell_arg like the other printed commands. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVLYAKjmToB1PDDGR6u1Hk * test(paste): paste every printed command into every shell from a foreign directory Adds the printed_command_paste harness and an advisory lane that runs it on Linux, macOS and Windows. The main ripr flows run against a repository whose root and source names hold spaces, apostrophes, typographic quotes, backticks, `$` and `;` payloads and non-ASCII text, with an absolute and a relative --root. Every command printed in text, Markdown, JSON and the written artifacts is pasted into bash, sh, zsh, PowerShell 7 and Windows PowerShell from a foreign directory, with argv recorders standing in for ripr and git. A command fails when it does not reach the program exactly once, passes different argv in different shells, passes a fragment of a hostile name, names a --root other than the fixture, or leaves a canary or any file beside the shell. Known gaps found on the stacked #5188, #5232, #5247 and #5269 heads are listed in a strict ledger: a listed gap is reported, and a row that stops reproducing fails until deleted. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WjGXVbKLB8gcwRvXFgbEqG * Fix Windows paste lane: PowerShell 5.1 JSON array, Git Bash PATH order Windows PowerShell 5.1 passes a piped JSON array on as one object, so the runner iterated once and recorded no calls. Git for Windows' bin/bash.exe launcher puts mingw64/bin ahead of PATH, hiding the git recorder. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WjGXVbKLB8gcwRvXFgbEqG * Paste lane: require shells per matrix entry, batch known-gap PowerShell cases The required Rust lane runs this test without zsh, so a missing shell is only fatal where the paste workflow names it in RIPR_PASTE_REQUIRE. Known-gap PowerShell cases run in their own batch so a canary from any other command is no longer excused. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WjGXVbKLB8gcwRvXFgbEqG * Print PowerShell forms for card, pilot, repair-before and workflow Missing Inputs commands Four of the paste lane's known gaps. The first-pr missing-base sentence stays listed: first_pr.rs belongs to #5188. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WjGXVbKLB8gcwRvXFgbEqG * Paste lane: pilot closing-block PowerShell form, per-gap problem predicates, review fixes Review of 1693807 found the pilot 'Next, in order' command without a PowerShell form, known-gap rows excusing any problem on a matching command, GapShells::Every cases in the canary-excusing batch, an unescaped recorder path in BASH_ENV, no git -C root check, and docs that overstated how a missing shell is handled. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WjGXVbKLB8gcwRvXFgbEqG * test(paste): excuse only the listed gap's ROOTCANARY effect in the known-gap batch Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WjGXVbKLB8gcwRvXFgbEqG * docs(changelog): scope the paste-lane claim to the flows it runs Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WjGXVbKLB8gcwRvXFgbEqG --------- Co-authored-by: Claude <noreply@anthropic.com>
Summary
Before: two printed commands interpolated values raw.
review_commentsgap-ledger cards printedripr first-action --root <root> --gap-ledger <path>, and the test-oracle assistant proof printedripr agent start --root … --seam-id <id>andripr agent verify --root … --before … --after …. Seam ids embed the source file path, so a file likesrc/it's;x.rs(idprobe:src_we ird_it's;x.rs:predicate:ec6d6f91) split the pasted command at the space and ran the tail after;.After: those values go through
shell_arg, the same quoting the other printed commands use. Plain values print unchanged, so the canonical fixture and goldens are untouched.How: audit of the remaining
format!("ripr … {value}")command sites after #5232.navigation.rs,first_pr.rs,repair_attempt,agent_status.rs,pr_summary/json.rsand the LSP hover commands already quote; the remaining hits were test code. The witnessexplain_commandis fixed on #5232.app/repair_card_handoff.rsis deliberately not touched because #5247 is rewriting those lines.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Governing issue or accepted claim: follow-up audit to the PowerShell quoting work in #5232.
Acceptance delta (one sentence): printed first-action and proof-handoff commands paste as the intended arguments for roots, paths and ids containing spaces, apostrophes and semicolons.
Candidate Relationships
Stack parent or prerequisite PR: none. Disjoint from #5232 (different files) and #5247 (does not touch
repair_card_handoff.rs).Scope
output/review_comments.rsfirst-action command;output/test_oracle_assistant_proof.rsstart and verify commands.Non-goals: PowerShell variants for these JSON fields,
repair_card_handoff.rs.Proof
cargo test -p ripr --lib -- test_oracle_assistant_proof review_comments_gap_ledger cargo xtask precommitResult: precommit passes locally. Two new tests assert the exact quoted strings for a hostile root, ledger path, snapshot paths and seam id. The quoted form was round-tripped through bash to a single argument earlier in the audit.
Claim Boundary
May claim: these three commands quote their dynamic values. Not claimed: every command-printing site is audited; the sweep covered
format!sites naming ariprsubcommand with a raw{}flag value.Rollback
Revert the commit.
Policy Impact
🤖 Generated with Claude Code
https://claude.ai/code/session_01FVLYAKjmToB1PDDGR6u1Hk
Generated by Claude Code