Skip to content

fix(explain): a file:line miss names where this scope's findings are (#14384) - #14400

Merged
EffortlessSteven merged 6 commits into
mainfrom
claude/project-thread-ro5x5s
Nov 13, 2026
Merged

EffortlessSteven merged 6 commits into
mainfrom
claude/project-thread-ro5x5s

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Summary

  • A file:line selector that matches no finding in ripr explain / ripr context keeps its no finding matched "..." message and adds one bounded sentence: the lines that do have findings in the named file (root-relative, with a selector that resolves), or the files that do (up to 5, then "and N more"), or that the scope has none.
  • A file:line:column selector is told Selectors are file:line; drop the column.
  • A suffix matching several files lists one file's lines (an exact path wins) and counts the rest.
  • Probe, repo-probe, gap and seam ids are unchanged; exit code stays 2; JSON refusal next stays null.
  • Routes: fresh explain, fresh context (shared path), explain --from, context --from.

Source-of-truth Links

Governing issue or accepted claim: #14384
Acceptance delta (one sentence): A file:line selector miss in explain/context now names the lines or files in scope that do have findings (with a resolvable suggested selector) and flags a stray column, on fresh and --from routes.

Candidate Relationships

Candidate branch: claude/project-thread-ro5x5s
Stack parent or prerequisite PR: none

Scope

  • crates/ripr/src/app/selector.rs (hint builder + unit test), app/explain.rs, app/context.rs, tests/cli_smoke.rs, changelog fragment.

Scope Classification

  • One production behavior

Evidence

Built by the errors/help lane and published on current main (46b6297), plus one review repair (b88c0d7): the hint now suggests only a file:line that select_finding resolves to exactly one finding, and points at probe ids when every listed line holds several findings.

Checks on head b88c0d7 (this session):

  • cargo test -p ripr --lib app::: 1055 passed.
  • cargo test -p ripr --test cli_smoke -- miss explain context selector drill: 108 passed.
  • cargo xtask precommit: exit 0 (no golden or output-surface file changed, so goldens check is not selected).

Independent review: a fresh subagent review of 51e5b2c raised an ambiguous-suggestion finding, repaired in b88c0d7; a second fresh subagent review of b88c0d7 reported no blocking findings (two wording nits left as is). Bot reviewers were rate-limited.

Merge of main (3cd01df) at dc284e3: clean, no file overlap with this diff's source or tests; reran cargo test -p ripr --lib app::selector (16 passed) and cargo test -p ripr --test cli_smoke -- miss explain context selector drill (108 passed) on the merged head.

Late bot review (Devin) repaired in 789be79: hint paths render through the shared finding_location_text projector (Windows verbatim paths show root-relative), RIPR-SPEC-0003 states the hint contract with traceability for its tests, and path-guard boundary cases are added; the extensionless-selector suggestion is answered on its thread. A fresh subagent review of that commit reported no blocking findings. Checks on 789be79: cargo xtask precommit exit 0, cargo test -p ripr --lib app::selector 16 passed, cli_smoke miss/explain/context/selector/drill 108 passed, check-traceability and check-spec-format pass.

Merge of main at 1830973 resolved a conflict with #14170 (#14077 miss-cause clause on fresh runs); f05949d integrates the two: the cause reports structurally when it already names the same file's other finding lines (the hint then does not repeat them), returns no clause for a file:line:column selector so the column note stands alone, and names those lines root-relative. Follow-up for the cause's unchecked retry lines: #14492. Fresh subagent reviews of the merge and of f05949d reported no blocking findings (merge review findings were repaired in f05949d). Checks on f05949d: cargo xtask precommit exit 0; cargo test -p ripr --lib app:: 1055 passed on the merge; cli_smoke miss/explain/context/selector/drill/location 110 passed; location_miss and explain_location_miss_cause (6) pass after f05949d.

Source review: REVIEW_READY f05949d

https://claude.ai/code/session_01YVdGzUyYRhWEmeAR1YkniC


Generated by Claude Code

…14384)

ripr explain and ripr context answered a location selector that matched
nothing with only a listing command, so the next try needed a second
run. The refusal now adds one bounded sentence: the lines that hold
findings in the named file (root-relative, with a selector that
resolves), or the files that do, or that the scope has none; a
file:line:column selector is told to drop the column. A suffix that
matches several files lists one file's lines and counts the rest. The
fresh route and both --from artifact routes share it; exit stays 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzTy2PRterqDJuSXY8V
@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 self-assigned this Nov 11, 2026
@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 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 145 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: c78f2d41-e279-4342-89a8-8dd9e47fd174
Commits

Reviewing files that changed from the base of the PR and between b9f04db and f05949d.

Files selected for processing: 7

  • .ripr/traceability.toml
  • changelog.d/explain-location-miss-hint.md
  • crates/ripr/src/app/context.rs
  • crates/ripr/src/app/explain.rs
  • crates/ripr/src/app/selector.rs
  • crates/ripr/tests/cli_smoke.rs
  • docs/specs/RIPR-SPEC-0003-agent-context.md
Pre-merge checks: Inconclusive 2

Failed Failed checks: 2 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Description check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…#14384)

A line shared by several findings would refuse as ambiguous on retry, so
the miss hint now suggests the first listed line whose selector resolves
to exactly one finding, or points at probe ids when every line is shared.

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

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

Exact-head review (head b88c0d7)

Surfaces read: full diff vs merge-base 46b6297 (commits 51e5b2c + b88c0d7); governing issue #14384; crates/ripr/src/app/selector.rs (new location_miss_hint + unit test), app/explain.rs (fresh + --from wiring), app/context.rs (fresh + --from wiring), tests/cli_smoke.rs (new e2e), changelog.d/explain-location-miss-hint.md; related resolvers (select_finding, selector_matches_file_line, no_finding_matched, note_selector_miss) for the matching-site audit.

Route coverage observed: all four claimed routes append the hint — fresh explain via no_finding_matched_fresh_run (explain.rs:380-385), fresh context through the same shared function (context.rs:156-169), explain --from (explain.rs:527-536), context --from (context.rs:242-253). The suggested selector is re-validated through the production select_finding requiring Unique (selector.rs:328-334), so the "select one as" advice cannot itself refuse as ambiguous on retry; the smoke test proves this end to end by re-running the suggested selector (cli_smoke.rs:25183-25195). The typed selector never reaches a suggested command (prose only); the CLI refusal keeps next null (usage_refusal.rs:100-107).

Commands run (isolated target dir in the review worktree; Windows host, pinned toolchain 1.95.0):

  • cargo fmt --check: exit 0.
  • cargo test -p ripr --lib app::selector::: 16 passed, 0 failed, exit 0 — includes the new location_miss_hint_names_lines_files_and_the_column_form.
  • cargo test -p ripr --test cli_smoke location_miss_names_where_findings_are: 1 passed, 0 failed (14.88s), exit 0 — pins exit 2, the base miss text, and that the suggested selector resolves on fresh explain, explain --from, and context --from.
  • cargo clippy -p ripr -- -D warnings: exit 101 with 5 dead-code errors, all in files this PR does not touch (edit_cage/mod.rs:2133 unused parameter; lsp/backend.rs:14646,14667,14693,14720 unreferenced mountinfo/remote-fs items). The same items are present and equally unreferenced at merge-base 46b6297 (checked via git grep on both trees), so the condition is inherited, not introduced. This was a lib-only default-features pass, not the CI lane.
  • CI at head via API: check runs show 7 success / 22 skipped (draft lanes) / 1 neutral (CodeRabbit); no failing runs, nothing cancelled-required.

Findings:

  • [low] selector.rs:311-314 — the hint's file grouping re-implements the three-way suffix match of selector_matches_file_line (selector.rs:253-255) instead of sharing one helper. If the production matcher changes, the listed lines or leading file could drift from real matching. Mitigated: the suggested selector itself is validated through the real resolver, so only the presentation, not the actionable advice, can drift. Path-component-anchored / suffixing prevents substring false credit between sibling names today.
  • [low] tests/cli_smoke.rs:25121 — the new e2e pins fresh explain and both --from routes but not a fresh context invocation; fresh context is covered by construction through the shared no_finding_matched_fresh_run path (context.rs:156), not by its own assertion. Issue acceptance is still met through the shared fresh-run path.

What is not established: the PR-body counts (1055 lib tests, 108 smoke tests, cargo xtask precommit) were not reproduced here — this review ran the narrower selector-module and single-smoke-test subset named above, fmt, and lib-only clippy. Hosted full-CI lanes are skipped on the draft and remain owned by hosted CI. No golden or fixture files changed in the diff, so the narrow goldens check had nothing selected to run and was not run.

No blocking findings: behavior matches issue #14384's four branches, the id-prefix exclusions, the exit-2 contract and the bounded-list wording; the unit test pins each branch and the exclusions.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 12, 2026 01:45
@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!

Copy link
Copy Markdown
Member Author

cargo-deny is red on this head because of RUSTSEC-2026-0486, an unsound advisory against rustix 1.1.5 (xattr functions). The advisory came out after this branch was cut. This PR touches no dependencies, and main has the same red, tracked in #14239. The fix is open as #14240, which bumps rustix to 1.1.6. I'm not widening this PR with the bump. If the required Result turns out to depend on cargo-deny, I'll port the #14240 bump here instead.


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 3 potential issues.

Devin Review

Comment thread crates/ripr/src/app/selector.rs Resolved
Comment thread crates/ripr/src/app/selector.rs Resolved
Comment thread crates/ripr/src/app/selector.rs Resolved
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

ripr static exposure check

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

#ripr agent static-advisory base=b9f04dbe223ba6ea8e71561a3f84e2be8d91ea1d findings=132 gaps=1 infection_unknown=5 propagation_unknown=8 static_unknown=65 weakly_exposed=54
weakly_exposed|crates/ripr/src/app/selector.rs:295|wanted.is_empty() \|\| !(wanted.contains(['/', '.']))|missing=No detected boundary input for the changed predicate|test=t1|id=probe:crates_ripr_src_app_selector.rs:predicate:b72e802b
stages=reach:yes,infect:weak,propagate:yes,observe:yes,discriminate:yes
t1=crates/ripr/src/app/selector.rs:669 location_miss_hint_names_lines_files_and_the_column_form exact_value `assert!(matches!( select_finding(&findings, "src/lib.rs:3"), FindingSelection::A…`
limits=infection_unknown:5,propagation_unknown:8,static_unknown:65,weakly_exposed:53
next=ripr explain --root . --base b9f04dbe223ba6ea8e71561a3f84e2be8d91ea1d --committed --mode draft --format agent probe:crates_ripr_src_app_selector.rs:predicate:b72e802b
verify=refused|outcome=complete_with_findings|findings=132|exposed=0|reason=gaps_remain

Took 85s.

…tor; spec the hint (#14384)

The hint now renders each file root-relative through finding_location_text,
so a Windows verbatim finding path under a plain-drive root is shown as
src/lib.rs rather than //?/C:/repo/src/lib.rs. RIPR-SPEC-0003 states the
location-miss hint contract and the traceability entry maps its unit and
CLI tests. Adds path-guard boundary cases (rust:12, :12, ./:12).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzUyYRhWEmeAR1YkniC
@github-actions

Copy link
Copy Markdown
Contributor

merge-ready is set, but this PR conflicts with main (head 789be79b), so GitHub creates no test-merge ref and no qualification run can start. Merge main into the branch and resolve the conflicts, then remove and re-apply merge-ready.

…-ro5x5s

# Conflicts:
#	crates/ripr/src/app/explain.rs
…n hint

The cause now reports structurally whether it named the same file's other
finding lines, instead of the hint matching its text; it returns no clause
for a file:line:column selector (which it read as a misspelled path) so
the hint's column note stands alone; and it names those lines
root-relative through finding_location_text, since a fresh run stores
absolute paths. CLI coverage for the column and root-relative cases.

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

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

VERDICT: APPROVE f05949d — no blocking findings on this head.

Refresh of my exact-head review at 789be79 (the last head I reviewed). Movement since then: f05949dc36 "integrate the #14077 miss cause with the #14384 location hint" — 62 lines in crates/ripr/src/app/explain.rs plus 25 lines of CLI coverage. This is the only substantive delta, so I re-read the whole miss-message path rather than only the diff.

What the integration does, checked against source.

  • The cause now reports structurally whether it already named the same file's other finding lines (LocationMissCause { text, names_same_file_lines }) instead of the caller matching the message prefix "No finding is at line". The flag is set only in the same-file branch and false on every other return, so the #14384 hint is suppressed exactly when the cause already listed those lines. That removes the text-coupling defect the old starts_with check carried.
  • A file:line:column selector now returns no cause clause. The guard splits the selector twice and treats an all-digit middle segment as a column, which is the same rule location_miss_hint uses (app/selector.rs), so the hint's "Selectors are file:line; drop the column." note stands alone instead of being preceded by a "not the path of a file" claim. I confirmed the hint still fires for that shape and still names the column.
  • The listed lines are now rendered root-relative through finding_location_text, which is the same projector the hint uses. A fresh run stores absolute (on Windows verbatim) paths, so the previous text could show an absolute path where every other rendered location is root-relative. The new CLI assertion pins src/lib.rs: in the message.

New low finding, non-blocking. crates/ripr/src/app/explain.rs:441-447: the column guard treats any selector whose second-to-last segment is all digits as a column form. For a file with no extension whose name is all digits — src/2024:10 — the cause is suppressed, and location_miss_hint also declines it because the remaining path src contains neither / nor .. That selector therefore loses both the cause and the hint, where before this commit it got the cause. The shape is narrow (a Rust file would be 2024.rs, which is not all digits) and the failure is a quieter message, not a wrong one, so I am not blocking on it. Sharing one column-detection helper between explain.rs and selector.rs would also stop the two copies from drifting.

Prior low findings, unchanged and still non-blocking. The hint's file grouping still re-implements the three-way suffix match of selector_matches_file_line (mitigated because the suggested selector is re-validated through the real resolver), and the new e2e still pins fresh explain plus both --from routes but not a fresh context invocation (covered by construction through the shared fresh-run function).

Checks at this head. Ripr Rust Small Result success (all four shards plus the gates job), Admit PR Candidate, Route Ripr Rust Small and Detect Docs-Only Surface success; no failing check at all at this head. 0 unresolved review threads.

Not established. I did not run the test suite for this delta; the analysis is static, read at this head. The PR-body counts and the full hosted matrix were not reproduced here.

Read-only: no checkout, branch or worktree created; the repository was read through git show/git diff and the API.

@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
VERDICT: APPROVE f05949d — no blocking findings on this head.

Repair: the prior verdict-only review carried no admission marker, so the merge-queue eligibility recheck would refuse this entry. This review restores the marker at the same head.

Merged via the queue into main with commit 6959344 Nov 13, 2026
80 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/project-thread-ro5x5s branch November 13, 2026 01:40
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