Skip to content

fix(mcp,lsp): name a head-only match arm's result in get_gap and hover (#14683) - #14689

Merged
EffortlessSteven merged 2 commits into
mainfrom
claude/project-thread-gv58kj
Nov 15, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
claude/project-thread-gv58kj

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Summary

#14458 made the agent gap row and the human digest name a head-only match arm's result (Size::Medium => 450). This PR carries the same rule to MCP ripr_get_gap and the editor hover.

  • with_arm_result moves from output/human/sections.rs into the shared output/flow_sink_line.rs owner. A new head_only_arm_result(finding) lets the human rows, MCP and LSP all read one rule.
  • MCP: changed_behavior.arm_result is added only when the flow model read a result. expression stays the head, and other gaps keep their bytes.
  • LSP: the finding hover's changed expression witness line and the line-findings hover heading join the result. This is hover text only; diagnostic data, diagnostic ids and finding identity keep the head.

The third surface on #14683, the ripr agent brief seams, has no flow sinks and needs a seam-level read, so it follows in a separate PR.

Governing issue or accepted claim: #14683
Acceptance delta (one sentence): MCP get_gap and the LSP hover name a head-only match arm's result under the same fail-closed rule as the agent gap row, with diagnostic data and identities unchanged.

Swarm / Source Boundary

Ordinary ripr-swarm development PR (protected squash).

Source-of-truth Links

Candidate Relationships

Follows #14458 (merged). No open PR implements the same claim.

Scope

output/flow_sink_line.rs, output/human/{sections,agent,agent_tests}.rs (call sites only), mcp/gaps.rs, lsp/hover.rs, lsp/tests.rs, two docs and a changelog fragment.

Scope Classification

Output projection, additive. Classification, finding ids and goldens are unchanged.

Proof

# commands run
cargo test -p ripr --lib -- arm_result flow_sink_line output::human:: lsp::hover lsp::tests::hover mcp::gaps   # 488 passed
cargo xtask precommit   # exit 0 on 7d544ec4
cargo test -p ripr --lib -- arm_result   # 4 passed on a5ad5506 (after the Gemini refactor)

New tests:

  • mcp::gaps::tests::get_gap_names_a_head_only_arm_result: arm_result is 450 and expression stays the head. The field is absent for a sink on another line and for a non-arm probe.
  • lsp::tests::hover_names_a_head_only_arm_result: both hovers read Size::Medium => 450, and diagnostic data does not. An off-line sink is not joined.
  • The existing head_only_arm_row_names_the_arm_result keeps covering the moved helper: off-line sink, head-text sink, different head, string-pattern arrow and non-arm probe.

Review: a fresh independent subagent review of 7d544ec found no defects. It confirmed that the joined text stays out of diagnostic data, fingerprints, identities and the DiagnosticWitness outside the hover, and that the MCP changed_behavior schema is untyped (object|null). It noted that ripr_prepare_repair copies changed_behavior, so it carries arm_result too; that is now documented. Gemini's allocation suggestion is applied in a5ad550.

Source review: REVIEW_READY a5ad550

Claim Boundary

May claim: MCP get_gap and the LSP hover name a head-only arm's result. Must not claim: agent brief seams changed; that is the follow-up PR on #14683.

Rollback

Revert the squash commit. There are no data or cache changes.

Static Language Check

No new static-outcome wording.

CI Economics

Hold merge-ready until the queue signal is under 10.

https://claude.ai/code/session_01YVdGzSVoFk423AYBoQAi61


Generated by Claude Code

#14683)

Move with_arm_result into the shared output::flow_sink_line owner and add
head_only_arm_result, so the human rows, MCP and LSP read one rule.
ripr_get_gap gains changed_behavior.arm_result (present only when read);
the finding hover's changed expression and the line-findings heading join
the result. Diagnostic data and identities keep the head.

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

coderabbitai Bot commented Nov 14, 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 42 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: f3b010ee-7e05-459e-919f-6b7a5e1f849b
Commits

Reviewing files that changed from the base of the PR and between 3a2eaa7 and a5ad550.

Files selected for processing: 10

  • changelog.d/14683-arm-result-mcp-and-hover.md
  • crates/ripr/src/lsp/hover.rs
  • crates/ripr/src/lsp/tests.rs
  • crates/ripr/src/mcp/gaps.rs
  • crates/ripr/src/output/flow_sink_line.rs
  • crates/ripr/src/output/human/agent.rs
  • crates/ripr/src/output/human/agent_tests.rs
  • crates/ripr/src/output/human/sections.rs
  • docs/OUTPUT_SCHEMA.md
  • docs/interop/mcp.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

gemini-code-assist[bot]

This comment was marked as resolved.

…e_repair carries arm_result

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzSVoFk423AYBoQAi61
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 14, 2026 10:02

@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 for head a5ad550

Inspected the full diff: the helper move into output/flow_sink_line.rs, the MCP changed_behavior.arm_result field, the two hover joins, tests and docs. A fresh subagent review of 7d544ec found no defects. The joined text stays out of diagnostic data, fingerprints and identities. The later commit is a one-line equivalent refactor plus a docs note. Local proof: precommit exit 0 on 7d544ec; arm_result tests pass on this head.


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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

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

No blocking findings on this head.

Exact head a5ad550 (base main). Hosted Rust gates, all four test shards, shards verify and the Result aggregator are green on this head (run 43583326110, head a5ad550).

  • head_only_arm_result keeps the #14420 rule: match-arm family, one => on comment/string-masked text, and a MatchArm sink on the probe's line whose text is not the head. with_arm_result joins only when the text is whitespace-equal to the probe expression, so a before head is never paired with the new result.
  • MCP changed_behavior gains arm_result only when read; expression stays the head and the other keys are unchanged. ripr_prepare_repair reads the same gap_evidence_core, so the doc claim holds.
  • LSP hover joins the result in the line heading and the witness changed expression; diagnostic data and identity are untouched. The new test covers the on-line, off-line and non-arm cases.
  • The move out of sections.rs leaves no unused import; every call site is updated.

Not checked: no local build or test run. The PR body's precommit claim names 7d544ec, not this head; the hosted gates at this head are the affirmative evidence.

@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 for head a5ad550

Merge stage. Ripr Rust Small Result is success on this exact head (check run 132420942895, completed 10:37:31Z; run 43583326110 with Rust gates, four hosted test shards and the shard-cover verify green, vscode surface green). Head committed 10:01:21Z, so it has been frozen for nearly five hours. One review thread, resolved; zero unresolved. The source-stage verdict on this head is review 5903994853 (11:07:25Z); I did not post it, and the checks below are my own.

What I checked that the source pass did not:

  • The new helper trusts sink text, so I checked the producer that writes it. head_only_arm_result accepts any MatchArm sink on the probe's line whose text differs from the head; it does not re-derive the pairing. That is only safe because flow.rs::same_line_arm_result already refuses unless the masked line holds exactly one =>, compact(line[..arrow]) == compact(head_without_arrow), and the tail is short, brace-free, Err(-free, comment-free and string-terminated. So the input that would name a wrong arm result — a two-arm line, or a line whose head is not the probe's head — cannot produce the sink in the first place. The doc's fail-closed list and the producing code agree; the consumer is not the guard.
  • The refactor cannot move existing human bytes. The old inline guard was compact(head) == compact(probe.expression); the shared function filters with head.split_whitespace().eq(probe.expression.split_whitespace()). Those are the same predicate, so the digest, agent gap row, propagation and local-flow lines render identically and only a probe-own head can be joined. The before head keeps its bytes because it is not whitespace-equal to the probe expression.
  • The docs' third claim is true, not aspirational. mcp/repair.rs:936-941 clones pointer("/changed_behavior") out of the same GapItem::evidence_core the gap tool serves, so ripr_prepare_repair's packet carries arm_result automatically. Nothing had to be added there, and nothing was.
  • The lane that made this head green actually runs the two new tests. rust-test-shards.yml runs cargo nextest run --workspace --profile ci; both new tests are in-crate mod tests (lib target), so a shard would have failed on them. Docs gate and vscode extension e2e were skipped on this head, which is unrelated to the change.
  • The hover mutation is display-only. diagnostic.data is never written; the joined witness only feeds push_diagnostic_witness and FixInstructionSummary::from_witness.

Negative control, by inspection: deleting the object.insert("arm_result", ...) turns get_gap_names_a_head_only_arm_result red, and removing the join turns hover_names_a_head_only_arm_result red. Both assert behaviour the pre-change code did not have.

Non-blocking, same body:

  • The hover's Fix instruction: line also picks up the joined expression, because fix_instruction.rs:304 records changed_expression as a source fact. That is a third hover line beyond the two docs/OUTPUT_SCHEMA.md names; harmless, but the doc undercounts.
  • No fixture golden enumerates the MCP changed_behavior object, so goldens check cannot go red for the added key; the byte-stability of other gaps rests on the "insert only when read" guard plus the unit test, not on a golden.
  • The MCP test covers present / off-line / non-arm but not the head-shape refusal (an expression that is already a full arm), which only the human agent test exercises.

Not verified: no local build, test or fmt, and no Windows execution. The hosted result is the only execution evidence.

Copy link
Copy Markdown
Member Author

FYI from #14727 (#14327's compact ripr_get_gap text): the opt-in RIPR_MCP_TEXT_CONTENT=brief gap text already shows changed_behavior.arm_result when it is present, as changed: <before> -> <after>; arm result: <result>; probe: <family>. A unit test pins this. The two PRs don't depend on each other and touch different code: this PR adds the field, and #14727 only projects it. Whichever lands second needs no change.


Generated by Claude Code

Merged via the queue into main with commit 3b1ec25 Nov 15, 2026
22 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/project-thread-gv58kj branch November 15, 2026 01:27
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