Repository navigation
fix(explain): a file:line miss names where this scope's findings are (#14384) - #14400
Conversation
…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
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
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. View limit details
Pre-merge checks:
|
…#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
left a comment
There was a problem hiding this comment.
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 newlocation_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:2133unused parameter;lsp/backend.rs:14646,14667,14693,14720unreferenced mountinfo/remote-fs items). The same items are present and equally unreferenced at merge-base 46b6297 (checked viagit grepon 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
--fromroutes but not a freshcontextinvocation; fresh context is covered by construction through the sharedno_finding_matched_fresh_runpath (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.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Generated by Claude Code |
ripr static exposure checkCommit 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
|
|
…-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
left a comment
There was a problem hiding this comment.
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 oldstarts_withcheck carried. - A
file:line:columnselector 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 rulelocation_miss_hintuses (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 pinssrc/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
left a comment
There was a problem hiding this comment.
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.
Requested by Steven · project thread
Summary
file:lineselector that matches no finding inripr explain/ripr contextkeeps itsno 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.file:line:columnselector is toldSelectors are file:line; drop the column.nextstays null.explain, freshcontext(shared path),explain --from,context --from.Source-of-truth Links
Governing issue or accepted claim: #14384
Acceptance delta (one sentence): A
file:lineselector miss inexplain/contextnow names the lines or files in scope that do have findings (with a resolvable suggested selector) and flags a stray column, on fresh and--fromroutes.Candidate Relationships
Candidate branch:
claude/project-thread-ro5x5sStack 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
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:linethatselect_findingresolves 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) andcargo 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_textprojector (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 precommitexit 0,cargo test -p ripr --lib app::selector16 passed, cli_smoke miss/explain/context/selector/drill 108 passed,check-traceabilityandcheck-spec-formatpass.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:columnselector 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 precommitexit 0;cargo test -p ripr --lib app::1055 passed on the merge; cli_smoke miss/explain/context/selector/drill/location 110 passed;location_missandexplain_location_miss_cause(6) pass after f05949d.Source review: REVIEW_READY f05949d
https://claude.ai/code/session_01YVdGzUyYRhWEmeAR1YkniC
Generated by Claude Code