Skip to content

fix(explain): suggest check --format json in selector hints (#11570 item 4) - #11844

Merged
EffortlessSteven merged 1 commit into
mainfrom
cursor/explain-format-json-b2d3
Oct 31, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
cursor/explain-format-json-b2d3

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Explain selector miss, ambiguous, and limitation messages now suggest listing findings with ripr check … --format json instead of the --json alias, matching ripr check --help. Scoped commands (root, diff/base, --worktree, mode) keep their navigation args; only the JSON output flag spelling changes on the explain surface.

Advances #11570 (item 4 only; does not close the umbrella issue).

Source-of-truth Links

Governing issue or accepted claim: #11570

Acceptance delta (one sentence): Item 4 — explain recovery hints document --format json rather than --json.

Swarm / Source Boundary

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

Proof

  • cargo test -p ripr --lib 'app::explain::tests::' (10 tests)
  • cargo xtask precommit

Proof establishes explain list-command hints use --format json and unit tests cover the rewrite plus fixture miss paths.

Proof does not establish: ripr context, navigation.rs defaults, MCP, or other #11570 items.

Non-goals

  • Item 2 (check.rs / fenced surfaces)
  • Item 8 (help/core.rs)
  • Changing --json alias behavior in CLI
Open in Web Open in Cursor 

…tem 4)

Explain miss and recovery messages now rewrite scoped list commands to use
the documented `--format json` spelling instead of the `--json` alias.

Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
@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 Oct 31, 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 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 149 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: 9544be1e-5e5e-4feb-affd-9bfef3361e5e
Commits

Reviewing files that changed from the base of the PR and between 7eb558f and 205c106.

Files selected for processing: 1
  • crates/ripr/src/app/explain.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@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.

Self-review (REVIEW_READY)

Scope: #11570 item 4 only — crates/ripr/src/app/explain.rs.

Inspected: Fresh explain path, artifact --from path, no_finding_matched helpers, and unit tests. Fenced surfaces (check.rs, help/core.rs, context.rs) intentionally unchanged.

Behavior: explain_navigation_list_command rewrites navigation list_command() suffix --json → --format json, preserving scoped args. Artifact path no longer hardcodes a bare ripr check --json.

Tests: Added rewrite unit test; fixture miss test asserts --format json and rejects bare --json` in list hint.

Proof run locally: cargo test -p ripr --lib 'app::explain::tests::', cargo xtask precommit.

Residual: context.rs and navigation.rs still emit --json on non-explain surfaces (out of slice).

@github-actions github-actions 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.

Decision

  • Needs verification checks before upstream.

Verification questions

  • Confirm existing tests cover the core suffix rewrite but not every navigation.list_command() shape or spacing variant.
  • Confirm artifact explain paths reuse the same rewritten navigation helper, but their rendered output lacks a dedicated regression assertion.
  • Confirm the rewrite is suffix-specific and leaves commands unchanged unless their exact tail is ' --json'; other list-command spellings or argument orders require verification outside this diff.

Refuted

  • The helper changes only explain output, not the global --json alias or other navigation surfaces, matching the stated item-4 scope; a broader expectation of repository-wide --json removal would be a false premise.

Parked follow-ups

  • The seeded thread explicitly parks context.rs and navigation.rs, whose other-surface --json output is outside item 4; broadening this PR would mix unrelated surfaces.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.
  • The scheduled cargo-test task has no completed receipt in the available evidence, so execution of the claimed focused test remains unverified.
  • The changed unit test proves suffix rewriting, but the provided sensor packet has no successful ripr or cargo-test receipt, so the PR body's claimed 10-test execution is not independently evidenced here.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

merge-ready

@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.

Independent review (fresh-context reviewer, head 205c106): REPAIR_REQUIRED

Inspected:

  • The candidate's own change is a single file: crates/ripr/src/app/explain.rs (+58/-14). It adds EXPLAIN_JSON_FORMAT_SUFFIX (explain.rs:135) and explain_list_command (explain.rs:138-145), which rewrites a trailing --json on a navigation list command to --format json, and threads that through every explain-surface emission: the committed list command, the worktree list command, the ambiguous-match refusal, the selector-limitation refusal, the fresh-run no-match, and the artifact-path arms.
  • The rewrite is semantically correct. crates/ripr/src/cli/commands/check.rs:850-857 parses --format <value> through parse_format (crates/ripr/src/cli/parse/format.rs), and check.rs:842-847 accepts --json as the alias selecting the same OutputFormat::Json; select_output_format (check.rs:531-545) refuses only a conflicting pair, not the alias. --format json is therefore a valid ripr check spelling, and it is the documented one (README.md, crates/ripr/src/cli/help/swarm.rs, docs/SEMVER.md).
  • The rewrite is complete for the surface it targets. crates/ripr/src/app/navigation.rs:461-463 is the only producer of the command being rewritten — list_command() is format!("{} --json", self.list_prefix) — so --json is always the final token and strip_suffix(" --json") always fires. The producer keeps its canonical --json form and only the explain surface rewrites it, which is the right seam for a slice-scoped change.
  • Hosted proof at this head. The Rust-only feature lane is RED in two separate runs (job 124659895208 in run 41242770235; job 124650414965 in run 41239562785). The failing step is substantive, not infrastructural: step 9, "Test --no-default-features --features lang-rust", ends with error: 1 target failed: -p ripr --test cli_smoke and Process completed with exit code 101.
  • The failing test target. crates/ripr/tests/cli_smoke.rs reports test result: FAILED. 616 passed; 2 failed, and the two failures are named: check_worktree_drill_in_commands_reach_the_uncommitted_finding and selector_location_misses_explain_syntax_and_preserve_retry_scope.
  • The mechanism, read from the log's own assertion messages. cli_smoke.rs:2577-2581 builds the expected listing as format!("ripr check --root {} --diff {} --json", ...), and the second failure expects the worktree form ripr check --root ... --base HEAD --worktree --json (the same shape is asserted at navigation.rs:768 and :787). The production output at this head is the same command with --format json, which the log shows verbatim: "unmatched explain must name the scoped listing ripr check --root .../ripr-worktree-drill-in-...-111079-268 --base HEAD --worktree --format json" and "run ripr check --root .../ripr-selector-location-recovery-...-111079-592 --diff .../change.diff --format json to list available finding ids".
  • Attribution. The PR base 7eb558fb4727298c7da10702496c6b2f385f08bd is green for the same lanes: Rust-only feature lane = success, Ripr Rust Small Result = success, Ripr Rust Small on GitHub Hosted / Rust gates = success. The head is red on the lane whose only candidate change is the string this PR rewrote, and the two failing assertions encode the pre-change spelling. This is candidate-attributable, not a base or runner condition.
  • The PR's own added oracle, and its gap. explain.rs:700-712 adds a discriminator that the finding-id miss message contains --format json and does not contain a bare --json`, and explain.rs:738-747 adds explain_list_command_rewrites_json_alias_suffix. Both are unit oracles inside the file under change. The two integration oracles that assert the same user-facing string from outside the module were not updated, and they are the ones that fail.
  • Prior review evidence. The only prior review by EffortlessSteven on this PR is the author's own self-review (828 characters, no head SHA cited, no disposition header). It states "Tests: Added rewrite unit test; fixture miss test asserts --format json and rejects bare --json in list hint" and "Residual: context.rs and navigation.rs still emit --json on non-explain surfaces (out of slice)". This review is the first independent review bound to this head.

Blocking:

  • The change breaks a hosted lane and leaves the repository's own integration oracle asserting the pre-change behavior. The Rust-only feature lane fails at cli_smoke with exit 101, and the two failing assertions are exactly the strings this PR changes. The repair is to update the two expected listings to the --format json spelling — cli_smoke.rs:2577-2581 in selector_location_misses_explain_syntax_and_preserve_retry_scope, and the worktree listing in check_worktree_drill_in_commands_reach_the_uncommitted_finding (cli_smoke.rs:27457 onward). I would also add the inverse discriminator the PR currently lacks at the integration level: assert the emitted hint contains --format json and does not contain the bare --json alias. Today only the in-module unit oracle checks that, so an integration-level regression back to the alias would pass the integration suite. Until the two expectations are updated the lane is red and the change cannot land.

Non-blocking:

  • crates/ripr/src/app/explain.rs:266 still documents the worktree retry as ripr check --worktree --json in a doc comment on the very function whose emitted command now says --format json. That is a doc/behavior mismatch inside the file this PR edits and is worth aligning in the same change. crates/ripr/src/app/navigation.rs:457 likewise describes the producer's canonical form as "The ripr check --json command" — that one is the producer's own form and is correct as written.
  • The rewrite is a positional string operation on a rendered command. It is correct for the only producer (navigation.rs:461-463), whose --json is always the last token, and explain.rs:745-746 covers the idempotent case. I found no shape where --json is present but not final, so no surface is missed here; I note it because the coupling is positional rather than typed, so a future change to list_command() that moved --json off the end would silently stop the rewrite.
  • The ripr explain surface is not the only one that prints a list command. The author's own self-review records that context.rs and navigation.rs still emit --json, out of this slice. I did not verify whether every non-explain surface falls inside #11570's slice; if any of them also carries the "suggest the documented spelling" obligation, this slice leaves it open. Flagging as a scope question, not a defect in this change.
  • The four Rust tests shard N of 4 jobs and the Rust test shards verify job are cancelled at step 7, "Warm the cargo builds the policy tests spawn", with steps 8-11 skipped. The substantive step is cancelled and the later steps never ran, so those shards are unobserved — missing proof, not green and not red. The Ripr Rust Small Result job failed at step 2, "Recheck initially admitted eligibility", which is the eligibility-shaped failure seen elsewhere in this campaign and is consistent with runner exhaustion rather than a source defect. Neither changes the disposition, which rests on the Rust-only lane.

Not run:

  • No local build, test, clippy or fmt: this host has no Rust toolchain (rustc, cargo, rustup are absent from PATH), and the working checkout is shared with concurrent agents, so cargo xtask precommit, cargo xtask check-pr, cargo test -p ripr --no-default-features --features lang-rust and cargo test -p ripr --test cli_smoke were not executed here. The failure is read from the hosted job log, not reproduced locally.
  • The candidate's claim of a local cargo xtask precommit run was not re-executed and cannot be verified from this repository. Note that a local precommit pass would not have caught this: the failing assertions live in crates/ripr/tests/cli_smoke.rs, an integration target that a lib-scoped policy run does not exercise.
  • The full Rust gates lane was still in_progress at this head, and windows-advisory-subset was in progress. The full workspace proof is therefore not established at this head beyond the lane cited above.

Conclusion: the change itself is correct and well-scoped — --format json is the documented, valid spelling, the rewrite reaches every explain-surface emission, and the producer always places --json last so the rewrite cannot miss a surface. The defect is that the repository's own integration oracle for the changed string was not updated, and the hosted Rust-only lane is red as a direct result, with the base green for that same lane. The disposition is REPAIR_REQUIRED.

Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 205c106fa846585f2dda0aa7d0c79c5ba8bb8e8d. Not an approval.

@EffortlessSteven
EffortlessSteven merged commit 56444f1 into main Oct 31, 2026
85 of 96 checks passed
@EffortlessSteven
EffortlessSteven deleted the cursor/explain-format-json-b2d3 branch October 31, 2026 23:20
EffortlessSteven pushed a commit that referenced this pull request Nov 1, 2026
…int (ported from #11982, main red) (#11844)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmmtS6TLb59cjpSU9tX
EffortlessSteven pushed a commit that referenced this pull request Nov 1, 2026
EffortlessSteven added a commit that referenced this pull request Nov 1, 2026
… LSP order, selector tests) (#11995)

* test(cli): selector recovery tests accept the --format json listing hint (#11844)

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

* fix(lsp): canonical-group order follows stable keys, not snapshot order

#11862 replaced the string-keyed group map with a union-find keyed by root
index, so group order silently followed the order findings are listed in.
list_actionable_items_names_gaps_the_actionable_profile_hides (which documents
canonical-group key order) then failed deterministically on main. Order groups
by the lowest pre-merge key among their members (canonical:<gap> / raw:<anchor>).

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

* fix: repair main after #11950 (verdict-corpus expected rows)

Bless the two Rust verdict-corpus rows that moved limited to gap after
inline test use super::* stopped demoting binding arms (PR 11950).

Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>

* fix(process-policy): drop the orphaned run_chain.rs import entry (same change as #11975)

#11924 widened the std::process import in run_chain.rs, orphaning the
`use std::process::Command` allowlist row. Carrying #11975's one-line removal
here so a single PR turns both main-red steps green.

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

* test(verdict-corpus): label the eq-divert cases from a reachable mutant, not the equivalent edit

The earlier arm or return shadows both compared constants (5 and 6), so
moving 5 to 6 never changes any output: the edit is behavior-preserving and
the recorded mutant (the edit itself) was equivalent, not 'not equivalent'.
Re-derive truth from a mutant of the same line that is observable (constant 2)
and that the single diverted row cannot notice; relabel replays all four cases
with 0 drift and verdict-corpus check scores 0/5 false verdicts.

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

---------

Co-authored-by: t <a@b>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
EffortlessSteven added a commit that referenced this pull request Nov 1, 2026
)

* feat(check): hint the .gitignore entry on a first check when the artifact root is unignored (#11879)

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

* test(check): drive the real binary for the first-check .gitignore hint (#11879)

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

* chore(policy): allowlist the first-check hint integration test's process spawns (#11879)

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

* test(cli): selector recovery tests accept the --format json listing hint (ported from #11982, main red) (#11844)

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

* Revert the ported cli_smoke hunks; #11982 owns that fix (#11844)

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
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