Repository navigation
fix(mcp,lsp): name a head-only match arm's result in get_gap and hover (#14683) - #14689
Conversation
#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
|
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 42 minutes. View limit details
|
…e_repair carries arm_result Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSVoFk423AYBoQAi61
EffortlessSteven
left a comment
There was a problem hiding this comment.
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
EffortlessSteven
left a comment
There was a problem hiding this comment.
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_resultkeeps the #14420 rule: match-arm family, one=>on comment/string-masked text, and aMatchArmsink on the probe's line whose text is not the head.with_arm_resultjoins only when the text is whitespace-equal to the probe expression, so abeforehead is never paired with the new result.- MCP
changed_behaviorgainsarm_resultonly when read;expressionstays the head and the other keys are unchanged.ripr_prepare_repairreads the samegap_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.rsleaves 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
left a comment
There was a problem hiding this comment.
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_resultaccepts anyMatchArmsink on the probe's line whose text differs from the head; it does not re-derive the pairing. That is only safe becauseflow.rs::same_line_arm_resultalready 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 withhead.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. Thebeforehead 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-941clonespointer("/changed_behavior")out of the sameGapItem::evidence_corethe gap tool serves, soripr_prepare_repair's packet carriesarm_resultautomatically. 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.ymlrunscargo nextest run --workspace --profile ci; both new tests are in-cratemod tests(lib target), so a shard would have failed on them. Docs gate andvscode extension e2ewere skipped on this head, which is unrelated to the change. - The hover mutation is display-only.
diagnostic.datais never written; the joined witness only feedspush_diagnostic_witnessandFixInstructionSummary::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, becausefix_instruction.rs:304recordschanged_expressionas a source fact. That is a third hover line beyond the twodocs/OUTPUT_SCHEMA.mdnames; harmless, but the doc undercounts. - No fixture golden enumerates the MCP
changed_behaviorobject, sogoldens checkcannot 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.
|
FYI from #14727 (#14327's compact Generated by Claude Code |
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 MCPripr_get_gapand the editor hover.with_arm_resultmoves fromoutput/human/sections.rsinto the sharedoutput/flow_sink_line.rsowner. A newhead_only_arm_result(finding)lets the human rows, MCP and LSP all read one rule.changed_behavior.arm_resultis added only when the flow model read a result.expressionstays the head, and other gaps keep their bytes.changed expressionwitness 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 briefseams, 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
docs/OUTPUT_SCHEMA.md(CHANGED EXPRESSION),docs/interop/mcp.md(ripr_get_gap)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
New tests:
mcp::gaps::tests::get_gap_names_a_head_only_arm_result:arm_resultis450andexpressionstays 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 readSize::Medium => 450, and diagnostic data does not. An off-line sink is not joined.head_only_arm_row_names_the_arm_resultkeeps 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_behaviorschema is untyped (object|null). It noted thatripr_prepare_repaircopieschanged_behavior, so it carriesarm_resulttoo; 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-readyuntil the queue signal is under 10.https://claude.ai/code/session_01YVdGzSVoFk423AYBoQAi61
Generated by Claude Code