Skip to content

fix(output): name the old line of removed code in human-full, hover and MCP (Advances #15335) - #16554

Merged
EffortlessSteven merged 4 commits into
mainfrom
claude/project-thread-b4v4lq-oldline-surfaces
Nov 29, 2026
Merged

EffortlessSteven merged 4 commits into
mainfrom
claude/project-thread-b4v4lq-oldline-surfaces

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Summary

  • fix(check): report the old-file line on removal findings (Advances #15335) #16531 gave a finding on removed code its old-file line (base_line) in check JSON and in the removal-only rows of ripr check. The surfaces where a user or an agent reads one finding in detail still showed only the current-file position, which every line of one removed run shares.
  • The shared source sentence (Finding::source_currentness_disclosure) now ends with (old line N) when the finding carries one. --format human-full, LSP hover and the agent format's stop= reason take their wording from that one function, so all three name the old line.
  • LSP hover shows one finding per position, and the lines of one removed run share a position. The hover now adds "Other removed code at this position" with each other removed finding's old line, text, class and id (at most five rows, with a count of the rest).
  • The MCP gap document carries base_line beside its unchanged location, and the MCP brief prints source: base_deleted (old line N).

--format human-full, before and after:

  source:  base_deleted — base-side evidence, not a candidate edit target
  source:  base_deleted — base-side evidence, not a candidate edit target (old line 15)

Swarm / Source Boundary

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

Source-of-truth Links

Spec: docs/specs/RIPR-SPEC-0151-source-currentness.md
Governing issue or accepted claim: #15335 (first residual after #16531: old line on human-full, LSP hover and MCP)
Acceptance delta (one sentence): a finding on removed code that carries base_line names that old line in the human-full source: line, in LSP hover, in the MCP gap document and in the MCP brief.

Candidate Relationships

Candidate branch: claude/project-thread-b4v4lq-oldline-surfaces
Stack parent or prerequisite PR: none. Builds on merged #16531.

Scope

  • crates/ripr-contract/src/domain/probe.rs: source_currentness_disclosure appends (old line N) when base_line is set.
  • crates/ripr/src/mcp/gaps.rs: the gap evidence document inserts base_line when set.
  • crates/ripr/src/mcp/protocol.rs: the brief's source: reads base_line from the document.
  • RIPR-SPEC-0151, docs/OUTPUT_SCHEMA.md, docs/interop/mcp.md, one traceability fragment, one Changed changelog fragment.
  • crates/ripr/src/lsp/hover.rs, crates/ripr/src/lsp/backend.rs: the hover handler passes the other overlapping findings to finding_hover_response_among, which lists the removed ones.
  • 19 human-full.txt goldens re-blessed, and the hand-read fixtures/human_full_shared_parse_port/expected/library-human-lines.json (two source: entries).

Scope Classification

  • One production behavior

Production delta:

  • The disclosure sentence gains the suffix only for a finding that is not candidate-actionable and carries base_line. A candidate-current finding still discloses nothing, and a removed finding without base_line reads as before.
  • MCP: base_line is an additive key, present only when set. location.line is unchanged. The item's evidence digest changes for findings that gain the key.

Evidence/support delta:

  • only_a_candidate_current_finding_is_actionable_and_others_disclose_why (contract): the sentence with an old line, and no sentence for a candidate-current finding even when base_line is set.
  • hover_names_the_old_line_of_a_finding_on_removed_code: hover with and without the old line.
  • hover_over_removed_lines_sharing_a_position_names_every_old_line: through the real hover handler, two removed findings at one position both appear with their old lines.
  • explain_agent_stop_names_the_old_line_of_removed_code: the agent stop= reason carries the old line and stays a stop.
  • evidence_core_carries_the_old_line_of_a_finding_on_removed_code: MCP document key present, location unchanged, key absent when unset.
  • brief_gap_text_names_the_old_line_of_removed_code: MCP brief with and without.
  • crates/ripr/tests/cli_smoke/removed_base_line.rs: the real binary's --format human-full prints (old line 2) and (old line 3) for a two-statement removal in Rust, Python and TypeScript, and prints no old line when Rust withholds it for identical removed lines.
  • Goldens: 24 source: lines in 19 fixtures change, each only by the suffix.

Single acceptance criterion:

  • The same removed statement reads with the same old line on human-full, hover and MCP as in check JSON.

Non-goals:

Proof

cargo test -p ripr --test cli_smoke                            # 914 passed (includes removed_base_line and human_full_shared)
cargo test -p ripr-contract                                    # 523 passed
CARGO_BUILD_JOBS=1 cargo test -p ripr --lib --no-default-features --features lang-python,lang-rust \
  -- lsp:: mcp:: output::human                                 # 2330 passed at 9c3a10ca; explain_agent 17 passed at head
CARGO_BUILD_JOBS=1 cargo clippy -p ripr -p ripr-contract --lib --bins --test cli_smoke --all-features -- -D warnings   # exit 0
cargo xtask goldens check                                      # exit 0
cargo fmt --check                                              # exit 0
cargo xtask check-spec-format | check-traceability | check-changelog-fragments | check-static-language
cargo xtask check-user-text | check-output-contracts | check-fixture-contracts | check-doc-index
cargo xtask check-public-api | check-no-panic-family | check-architecture | check-generated-clean   # each exit 0

Not run locally: the whole in-crate unit suite (only the filtered set above, without the TypeScript feature) and Clippy over the lib test target. The full ripr test binary does not build in this 15 GB container. Hosted qualification is the evidence for both.

Risk

  • A consumer that matches the disclosure sentence as a whole string would miss the suffixed form. In this repository every reader uses contains or the function itself.
  • The agent format's stop= reason changes with the shared sentence. It stays a stop= line; no open= or done= state changes.

Claim Boundary

Static Language Check

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

https://claude.ai/code/session_01SvmPmpdxXspZqf95AL6HFR


Generated by Claude Code

…nd MCP

The shared source sentence ends with (old line N) when a finding on
removed code carries base_line, so human-full, LSP hover and the agent
stop reason name it. The MCP gap document carries base_line and its brief
prints it. Advances #15335.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmpdxXspZqf95AL6HFR
…e on detail surfaces

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

coderabbitai Bot commented Nov 29, 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 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 138 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: 17390e92-191d-4d2f-a7a5-5547a154d3e5
Commits

Reviewing files that changed from the base of the PR and between 56014e4 and b774590.

Files selected for processing: 52

  • .ripr/traceability.d/15335-old-line-surfaces.toml
  • changelog.d/15335-old-line-surfaces.md
  • crates/ripr-contract/src/domain/probe.rs
  • crates/ripr-contract/src/domain/probe/decision_helper_tests.rs
  • crates/ripr/src/lsp/backend.rs
  • crates/ripr/src/lsp/hover.rs
  • crates/ripr/src/mcp/gaps.rs
  • crates/ripr/src/mcp/protocol.rs
  • crates/ripr/src/output/human/agent_tests.rs
  • crates/ripr/tests/cli_smoke/removed_base_line.rs
  • docs/OUTPUT_SCHEMA.md
  • docs/interop/mcp.md
  • docs/specs/RIPR-SPEC-0151-source-currentness.md
  • fixtures/field_match_macro_option_shadow/expected/CHANGELOG.md
  • fixtures/field_match_macro_option_shadow/expected/human-full.txt
  • fixtures/field_match_raw_option_shadow/expected/CHANGELOG.md
  • fixtures/field_match_raw_option_shadow/expected/human-full.txt
  • fixtures/field_match_unexecuted_assertion/expected/CHANGELOG.md
  • fixtures/field_match_unexecuted_assertion/expected/human-full.txt
  • fixtures/human_full_shared_parse_port/expected/CHANGELOG.md
  • fixtures/human_full_shared_parse_port/expected/human-full.txt
  • fixtures/human_full_shared_parse_port/expected/library-human-lines.json
  • fixtures/match_arm_tuple_derived_conditional_exit_before_assertion/expected/CHANGELOG.md
  • fixtures/match_arm_tuple_derived_conditional_exit_before_assertion/expected/human-full.txt
  • fixtures/match_arm_tuple_derived_return_before_assertion/expected/CHANGELOG.md
  • fixtures/match_arm_tuple_derived_return_before_assertion/expected/human-full.txt
  • fixtures/match_arm_tuple_terminal_generated_constructor/expected/CHANGELOG.md
  • fixtures/match_arm_tuple_terminal_generated_constructor/expected/human-full.txt
  • fixtures/match_arm_tuple_terminal_imported_formatter/expected/CHANGELOG.md
  • fixtures/match_arm_tuple_terminal_imported_formatter/expected/human-full.txt
  • fixtures/match_arm_tuple_terminal_inherited_constructor/expected/CHANGELOG.md
  • fixtures/match_arm_tuple_terminal_inherited_constructor/expected/human-full.txt
  • fixtures/owner_return_pin_json_uncalled_closure/expected/CHANGELOG.md
  • fixtures/owner_return_pin_json_uncalled_closure/expected/human-full.txt
  • fixtures/propagated_error_closing_early_path/expected/CHANGELOG.md
  • fixtures/propagated_error_closing_early_path/expected/human-full.txt
  • fixtures/returned_comparison_rival_import/expected/CHANGELOG.md
  • fixtures/returned_comparison_rival_import/expected/human-full.txt
  • fixtures/rust_guard_return_changed_guard/expected/CHANGELOG.md
  • fixtures/rust_guard_return_changed_guard/expected/human-full.txt
  • fixtures/rust_nested_use_cfg/expected/CHANGELOG.md
  • fixtures/rust_nested_use_cfg/expected/human-full.txt
  • fixtures/rust_nested_use_dependency_alias/expected/CHANGELOG.md
  • fixtures/rust_nested_use_dependency_alias/expected/human-full.txt
  • fixtures/rust_nested_use_dependency_glob/expected/CHANGELOG.md
  • fixtures/rust_nested_use_dependency_glob/expected/human-full.txt
  • fixtures/rust_nested_use_owner/expected/CHANGELOG.md
  • fixtures/rust_nested_use_owner/expected/human-full.txt
  • fixtures/rust_sibling_effect_oracle/expected/CHANGELOG.md
  • fixtures/rust_sibling_effect_oracle/expected/human-full.txt
  • fixtures/whole_value_string_from_shadow/expected/CHANGELOG.md
  • fixtures/whole_value_string_from_shadow/expected/human-full.txt
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@EffortlessSteven EffortlessSteven self-assigned this Nov 29, 2026
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 29, 2026 02:28

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request implements RIPR-SPEC-0151 (#15335), which surfaces the old-file line number (base_line) for findings on removed code across various outputs, including the human-full format source line, LSP hover, agent format stop reasons, and MCP gap documents/briefs. It includes comprehensive updates to domain logic, unit and integration tests, specification documentation, and fixture golden files. There are no review comments to evaluate, and I have no additional feedback to provide.

@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/src/lsp/hover.rs Resolved

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

Findings on head 3a7f992 (independent source review by a session that did not write this candidate). One finding gates the marker; I am not posting it on this head.

Gating: two cli_smoke tests stop on a sibling expected file that was not updated

Run here at this head:

cargo test -p ripr --test cli_smoke -- removed_base_line human_full_shared
test result: FAILED. 6 passed; 2 failed
  human_full_shared::human_full_shared_preserves_complete_public_library_bytes
  human_full_shared::human_full_shared_real_git_diff_keeps_every_finding_and_replays_commands

Both compare the rendered human-full report with fixtures/human_full_shared_parse_port/expected/library-human-lines.json. That file still carries the two source: lines without the suffix:

base_deleted — base-side evidence, not a candidate edit target\n

while fixtures/human_full_shared_parse_port/expected/human-full.txt in this PR was re-blessed to ... not a candidate edit target (old line 3). The JSON line file is read directly by the test and is not part of the golden bless set, which is why cargo xtask goldens check stayed green. The four removed_base_line tests pass.

Repair: update the two source: entries in library-human-lines.json to the suffixed form. I did not check whether any other hand-read expected file embeds the sentence; a search for not a candidate edit target\n under fixtures/**/expected that are not human-full.txt would settle it.

Reviewed and clean

  • Shared sentence, ripr-contract/src/domain/probe.rs. source_currentness_disclosure appends (old line N) only when base_line is set and only on the non-actionable path; a candidate-current finding still returns None even if a line were set, and the helper test asserts both.
  • Readers of the sentence. Three production callers: output/human/sections.rs (human-full source:), lsp/hover.rs, and output/human/agent.rs (the stop= reason). No reader compares the whole string; human_full_shared.rs counts a prefix match. policy/output_contracts.txt lists the enum descriptions, not this sentence. The VS Code sources do not match on it.
  • Agent format. The stop= line gains the suffix inside its parenthesis and stays a stop= line. The PR body states this; no unit test pins the suffixed agent line, which I note and do not gate on.
  • MCP. mcp/gaps.rs inserts base_line into the evidence core only when present, with location.line unchanged; mcp/protocol.rs appends the old line to the brief's source: only when the item carries it. Both have a present and an absent case in their tests.
  • Goldens, checked by script. 19 human-full.txt files; all 24 changed lines are the source: line gaining the suffix.

Executed here

cargo test -p ripr-contract decision_helper: 16 passed. The cli_smoke filter above: 6 passed, 2 stopped. Not executed: the lib unit tests (hover, MCP), the rest of cli_smoke.

No bot review or thread is present on this PR yet.


Generated by Claude Code

… the hand-read human lines

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmpdxXspZqf95AL6HFR
…nd agent tests (#15335)

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

@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

Independent exact-head review of b774590 by a session that did not write this PR. It follows my findings at 3a7f992.

Delta read since 3a7f992

  • fixtures/human_full_shared_parse_port/expected/library-human-lines.json: both source: lines now carry the (old line 3) suffix, which is what the two stopped cli_smoke tests compared against.
  • lsp/hover.rs: finding_hover_response_among and other_removed_code_note list the other base-side findings at the same position with their base_line, bounded by MAX_LINE_HOVER_FINDINGS. finding_hover_response is test-only now.
  • lsp/backend.rs: hover passes the overlapping findings; new test hover_over_removed_lines_sharing_a_position_names_every_old_line.
  • output/human/agent_tests.rs: new test explain_agent_stop_names_the_old_line_of_removed_code.
  • Spec, changelog and traceability edits match the behaviour.

Executed at this head (Linux, default features)

  • cargo test -p ripr --test cli_smoke -- removed_base_line human_full_shared: 8 passed, 0 stopped. Both tests named in my earlier findings pass.
  • Whole ripr lib suite: 21,933 passed, 0 stopped, 4 ignored, including the two new tests above.

Not run here

  • VS Code extension tests, Windows and macOS lanes, and the Rust-only feature build. Hosted qualification covers those.

Note, not gating

  • other_removed_code_note wraps probe.expression in a single-backtick code span without escaping. An expression that itself contains a backtick (a TypeScript template literal) would end the span early in the rendered hover. The rest of the hover already renders expressions raw, so this is consistent with existing behaviour and can be a follow-up.

Generated by Claude Code

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