Skip to content

fix(cli): refuse a mistyped --root in reports ci-packet and feedback (#14222) - #14322

Merged
EffortlessSteven merged 3 commits into
mainfrom
claude/fuzz-command-root-14222
Nov 13, 2026
Merged

EffortlessSteven merged 3 commits into
mainfrom
claude/fuzz-command-root-14222

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Requested by Steven Zimmerman · project thread

Summary

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Governing issue or accepted claim: #14222
Acceptance delta (one sentence): a mistyped --root is refused by the shared root validator in these three commands instead of being created.

Candidate Relationships

Candidate branch: claude/fuzz-command-root-14222
Stack parent or prerequisite PR (if any): none (independent of #14137 and #14221)

Scope

  • One production behavior: explicit --root validation in three commands.

Production delta:

  • cli/commands/ci_packet.rs, cli/commands/feedback.rs: call ensure_command_root right after option parsing, before the output-containment check.

Evidence/support delta:

  • Real-binary test mistyped_root_is_refused_and_not_created (missing and file roots, three commands, asserts exit 2, the shared message, and that nothing was created).
  • Changelog fragment 14222-mistyped-root-refused.md.

Single acceptance criterion: a missing or non-directory --root exits 2 with the shared message and creates nothing.

Non-goals: policy readiness, policy waiver-aging, pr-comments plan, reports index and reports ci-summary also accept a bad --root today; they are listed on #14222 and left for a follow-up so this stays one reviewable change.

Proof

cargo fmt --check
cargo xtask precommit          # every policy check passed; the final lib-test build was SIGKILLed (16 GB container)
cargo test -p ripr --test cli_smoke -- mistyped_root feedback ci_packet   # 3 passed

Skipped: cargo test -p ripr --lib cannot build in the cloud container (OOM); hosted shards prove it.

Claim Boundary

May claim: these three commands refuse a bad explicit --root. Must not claim: all rooted commands are covered.

Rollback

Revert the commit; no schema, config or workflow change.

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

CI Economics

n/a


Generated by Claude Code

…14222)

reports ci-packet and feedback export created a missing --root as a new
directory tree and exited 0; feedback record shared the unvalidated root.
All three now go through the shared ensure_command_root validator.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016EQRViKVcCRPKXpZ4nm2UY
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 144 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 1a5287d7-edf4-4440-92fc-bb42972f21b8
Commits

Reviewing files that changed from the base of the PR and between f6cd8bd and fa2a4a1.

Files selected for processing: 4

  • changelog.d/14222-mistyped-root-refused.md
  • crates/ripr/src/cli/commands/ci_packet.rs
  • crates/ripr/src/cli/commands/feedback.rs
  • crates/ripr/tests/cli_smoke.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 11, 2026 10:43
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY

Source review of head 92837d3eb6b52c0fee78ad782fc8f1a450ceebd6.

Inspected

  • Complete diff (4 files): reports ci-packet, feedback export and feedback record now call the existing shared ensure_command_root right after option parsing and before the output-containment check. No second validator, and no decision moved into a renderer or helper.
  • Consumers: a valid directory root takes the same path as before, so existing output and goldens are unchanged. A missing or non-directory root now exits 2 with the shared message before anything is created.
  • Test stimulus and oracle: the real binary is run with a missing nested root and a file root for all three commands, asserting exit 2, the exact shared message, that the missing path was not created, and that the file is untouched. A revert makes ci-packet and export exit 0 and create the tree, so the test cannot pass by accident.
  • Scope limit, stated in the PR: five other commands also accept a bad --root; they stay on #14222 for a follow-up rather than widening this change.

Not established here

  • cargo test -p ripr --lib cannot build in the 16 GB cloud container; the hosted shards cover it. The focused real-binary tests passed locally.
  • Hosted qualification of this head is not run yet; this review requests it.

Generated by Claude Code

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread crates/ripr/tests/cli_smoke.rs Resolved

Copy link
Copy Markdown
Member Author

cargo-deny (Security workflow) is red here for a reason outside this change: it fails on advisories with RUSTSEC-2026-0486 (xattr 1.6.1 marks unwritten bytes as initialized for a zero-length buffer, reached via tar from xtask). The Security workflow is also red on main for every recent push (runs from 09:24Z to 10:43Z), this PR touches no dependency, and cargo-deny is not a required check (the ruleset requires Ripr Rust Small Result). No fix exists on main yet, so I am not widening this PR; the advisory needs its own dependency bump or a documented ignore.


Generated by Claude Code

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY

Source review of head 92837d3eb6b52c0fee78ad782fc8f1a450ceebd6, refreshed after the Devin thread was answered and resolved.

  • Complete diff inspected: reports ci-packet, feedback export and feedback record call the existing shared ensure_command_root right after option parsing, before the output-containment check. No second validator.
  • A valid directory root takes the same path as before, so output and goldens are unchanged; a missing or non-directory root exits 2 with the shared message before anything is created.
  • The real-binary test covers a missing nested root and a file root for all three commands and asserts exit 2, the shared message, that nothing was created, and that the file is untouched.
  • Scope: five other commands also accept a bad --root; they stay on #14222 for a follow-up.
  • Local limit: the lib-test binary cannot be built in the 16 GB cloud container, so hosted shards cover it. Hosted qualification of this head is requested by this review.

Generated by Claude Code

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

ripr static exposure check

Commit fa2a4a10a333 · run · advisory, static evidence only (not a mutation run).

#ripr agent static-advisory base=f6cd8bd02e3f06b71f4ddeea289e469b302543cd findings=3 gaps=3 reachable_unrevealed=2 weakly_exposed=1
reachable_unrevealed|crates/ripr/src/cli/commands/ci_packet.rs:82|crate::cli::commands_context::ensure_command_root(&options.root, COMMAND)|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t1|id=probe:crates_ripr_src_cli_commands_ci_packet.rs:call_deletion:481cb5ee
stages=reach:yes,infect:yes,propagate:yes,observe:no,discriminate:no
weakly_exposed|crates/ripr/src/cli/commands/feedback.rs:44|ensure_command_root(&options.root, "feedback record")|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t2|id=probe:crates_ripr_src_cli_commands_feedback.rs:call_deletion:145022bf
stages=reach:weak,infect:yes,propagate:yes,observe:no,discriminate:no
reachable_unrevealed|crates/ripr/src/cli/commands/feedback.rs:73|ensure_command_root(&options.root, "feedback export")|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t3|id=probe:crates_ripr_src_cli_commands_feedback.rs:call_deletion:faa91a07
stages=reach:yes,infect:yes,propagate:yes,observe:no,discriminate:no
t1=crates/ripr/src/cli/commands/ci_packet.rs:2831 ci_packet_refuses_target_ripr_review_and_target_ci_links unknown miss=assertion_admission_unproven
t2=crates/ripr/src/analysis/language/python/layout_tests.rs:497 a_capped_repo_run_records_no_project_names unknown miss=no_assertion
t3=crates/ripr/src/cli/commands/feedback.rs:413 export_refuses_target_symlink_escaping_the_workspace unknown miss=assertion_admission_unproven
next=ripr explain --root . --base f6cd8bd02e3f06b71f4ddeea289e469b302543cd --committed --mode draft --format agent probe:crates_ripr_src_cli_commands_ci_packet.rs:call_deletion:481cb5ee
verify=refused|outcome=complete_with_findings|findings=3|exposed=0|reason=unexposed_findings_remain

Took 50s.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEW_READY

Final pass on head 92837d3eb6b52c0fee78ad782fc8f1a450ceebd6.

  • Source: the earlier complete-diff review stands. The three commands call the existing shared ensure_command_root; no second validator; the real-binary test covers a missing and a file root for all three commands.
  • Exact-head hosted evidence inspected: Ripr Rust Small Result succeeded at 12:13Z on this head, as did the hosted Rust small job behind it. The latest run of every other check on this head is green except cargo-deny, which is the repository-wide RUSTSEC-2026-0486 advisory (red on main too, not required, owned by the rustix bump in #14240).
  • Review threads: the one Devin thread has a source-backed reply and is resolved. No other review or comment is open.
  • Not claimed: the other five commands that accept a bad --root stay on #14222.

Generated by Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016EQRViKVcCRPKXpZ4nm2UY

Copy link
Copy Markdown
Member Author

Conflict reproduction (2026-11-12): git merge-tree --write-tree --name-only f6cd8bd02e3f06b71f4ddeea289e469b302543cd 92837d3eb6b52c0fee78ad782fc8f1a450ceebd6 reports one conflict, crates/ripr/tests/cli_smoke.rs. It is adjacent independent test additions: main's endless-artifact/input-preservation tests versus this PR's mistyped_root_is_refused_and_not_created. Both blocks must be retained; no production-file conflict was reported. I am preparing an isolated reconciliation, with no remote branch change yet. Existing exact-head tests do not qualify a reconciled candidate; it will need renewed review/checks.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEW_READY

Review of head 1aefb564c503bc1f9d4a891c1b0717cd5b5ff133. This head merges main f6cd8bd into the previously reviewed head 92837d3. The only textual overlap was cli_smoke.rs, where both sides appended independent tests; both blocks are kept and no production file changed in the merge. The mistyped-root test passes on this head locally. Hosted qualification of this head is still to run.


Generated by Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016EQRViKVcCRPKXpZ4nm2UY

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEW_READY

Review of head fa2a4a10a33335784a579c28ff43c2d1945fbfaa. Relative to the previously reviewed merge head 1aefb56 this removes one stray blank line in cli_smoke.rs that the formatting preflight flagged; no code changed. The earlier review of the mistyped-root change stands.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 12, 2026

Copy link
Copy Markdown
Member Author

Independent reconciliation follow-up: the source owner has advanced this PR to fa2a4a10a33335784a579c28ff43c2d1945fbfaa, which is mergeable. I detected the changed head before updating its ref and did not publish a competing branch update.

The isolated reconciliation I tested has identical production files and identical test bodies; comparison with the published head shows only relocation of the unchanged 52-line mistyped_root_is_refused_and_not_created block within cli_smoke.rs. On that isolated tree (baadc3aff7aa778f0b1df6c25e93209852ea1741), Rust 1.95.0 cargo fmt --check and cargo test --locked -p ripr --test cli_smoke mistyped_root_is_refused_and_not_created -- --exact passed (1 test; 760 filtered). This covers all six missing/file-root command cases but is not an exact-published-head hosted result. The original production delta remains four files / 67 insertions against main f6cd8bd.

The existing source owner retains qualification and queue convergence. No duplicate hosted run or queue mutation was initiated by this pass.

Copy link
Copy Markdown
Member Author

Exact published-head independent verification completed on fa2a4a10a33335784a579c28ff43c2d1945fbfaa (tree ff66b783c2bfc4479fd021f8ba60cb2e11dd3816):

  • Rust 1.95.0 cargo fmt --check: passed.
  • CARGO_BUILD_JOBS=2 CARGO_PROFILE_TEST_DEBUG=0 CARGO_INCREMENTAL=0 cargo test --locked -p ripr --test cli_smoke mistyped_root_is_refused_and_not_created -- --exact: passed, 1 test / 760 filtered, 0.07s test execution after a 6m23s incremental build.
  • The regression exercises all three commands against both missing and file roots, checks exit 2/shared diagnostics, no directory creation and unchanged file contents.

This supersedes the prior comment's limitation that runtime evidence was only from the equivalent isolated merge tree. It remains focused Linux evidence, not a full-suite or merge-group result. No queue operation or duplicate hosted run was initiated; the existing owner retains convergence.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY
VERDICT: APPROVE fa2a4a1

Static review of the root-validation fix at this head.

Change. ensure_command_root is now called before any write in reports ci-packet, feedback record, and feedback export. It is the same shared validator ripr check uses.

Checks performed.

  • Placement is ahead of side effects: ci_packet() validates immediately after parsing and before ensure_report_output_contained/packet steps; run_record and run_export validate immediately after parsing and before ensure_report_output_contained/the app call.
  • The fix is load-bearing: reconcile_root only reconciles repeated --root values and never checks existence or directory-ness.
  • Error surface matches the test: a missing path or a non-directory yields "<command> root <path> is not a directory; pass the directory that contains the workspace ..."; main.rs maps Err to exit 2.
  • The integration test drives the real CLI for all three commands against both a missing nested path and a file path, asserts exit 2, the expected message, and that nothing was created or modified.
  • Parsing prerequisites the test relies on are real: --snapshot and --reason useful_actionable are accepted, and --root is accepted by reports ci-packet.

Non-blocking note. The missing-path case is a nested path whose first component does not exist (scratch/nope/deep). A missing single leaf under an existing directory is not a separate case in the test; the old code also created that leaf, so the regression coverage would be marginally stronger with it. Not blocking.

Not checked: no build or test run; this is static source plus test-shape reading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants