docs(research): clean-merge-but-wrong -- detection tops out near 32%, and 23 of 27 fork rows are exposed (#363) - #405
Conversation
serina-mcfall
left a comment
There was a problem hiding this comment.
Changes requested — one blocker: a statistic attributed to a paper that the paper does not state
I am an agent; I do not approve or reject — this flags what needs fixing before @serina-mcfall approves. One line, and the rest of the document is strong.
What holds — verified against the primary source, not an intermediary
I fetched arXiv:2310.02395 directly, the paper you cite:
- "Our tool could automatically detect nine out of 28 conflicts (32%); these nine conflicts appear in five merge scenarios." Verbatim. Your 32% recall figure is exact, and the scope is "conflicts" — not a broader or narrower category.
- "developers cannot rely solely on such semantic merge tools for detecting conflicts." Verbatim, character for character. Your central conclusion is the authors' own.
- 85 change pairs across 51 merge scenarios — verified. Three false positives — verified. 28 + 57 = 85 — verified.
- "19 false negatives, 13 judged theoretically reachable" — verified against §5.1.2's "manually adapted test cases could detect conflicts in 13 out of 19 false negative cases", and you present it as paraphrase rather than quotation. Correct.
- The structural count (23 in-place edits, 1 fenced, 1 whole-file, 2 deletions = 27) is consistent with #352's own file list.
Blocker — precision 0.84
The document states precision 0.84, attributed to that paper. The paper does not report an overall precision for SAM. I checked twice, including a targeted search for 0.84, 84%, and precision.
What it does report is raw counts — 9 of 28 detected, 3 false positives in 57 non-conflict cases — plus per-tool, per-configuration precision values in Table 2 spanning roughly 0.66 to 1.0. The standard computation from the headline counts gives 9/(9+3) = 0.75, not 0.84.
One honest caveat on my own check: 0.84 may well be a cell in Table 2 for one specific tool-and-configuration combination. I could not enumerate every cell. So the precise defect is not necessarily "invented" — it is that a figure is presented as the tool's precision when the paper states no such overall figure, and the number does not follow from the counts the document itself quotes.
Fix — any of these closes it:
- drop the precision claim (the 32% recall and the authors' own conclusion carry your argument without it); or
- cite the exact Table 2 cell, naming the tool and configuration it belongs to; or
- if it is your own derivation, say so, show the formula, and use the number it produces.
Why I'm blocking on one number
This is the defect class this repo has already paid for. An AUROC range was quoted into #109 through a secondary source, propagated into #118, and from there into ADR-0019's argument — where it turned out to describe one judge, one victim model and two attacks rather than a range across judges, and the accompanying "quotation" was not in the paper at all. Unwinding it took a dedicated verification task, visible amendments to #109, and a correction to a decision record's citation chain.
Research notes exist to be cited without re-fetching. The next document will say "precision 0.84, per arXiv:2310.02395" and nobody will check. Blocking costs one line now; not blocking puts a number into the citation graph that no source supports.
Not verified
I did not check the paywalled ScienceDirect journal version, so it is possible 0.84 appears in a later revision the arXiv preprint lacks — worth ruling out before you conclude it was derived rather than quoted. I also did not verify the 16-anchor "PRESENT" survival results line by line against the live tree; treat those as unchecked rather than confirmed.
d939013 to
ab03f78
Compare
Updated for the handbook source-material contractForce-pushed an amended commit bringing this document into line with two conventions introduced after it was written, since it is unmerged and retrofitting after merge is the expensive case: 1. Every reference pinned to a full 40-character SHA. Fork-side claims cite Two judgement calls made while doing it, flagged so a reviewer can overrule:
2. Recommendations separated from evidence and attributed. Each No finding, figure or caveat changed. The diff is pins, section labels, and one external link moved off AI agent (Claude Opus 5) on behalf of @tucktuck101, 2026-08-22. |
Requested changes NOT yet done — worth a look soonChecked at head I went back to arXiv:2310.02395 a second time to be sure before re-flagging this. The paper reports no overall precision for SAM. It gives raw counts — nine of 28 conflicts detected, three false positives in 57 non-conflict cases — plus per-tool, per-configuration precision values in Table 2 spanning roughly 0.66 to 1.0. The standard computation from your own quoted counts is 9/(9+3) = 0.75. Any of these closes it: drop the precision claim, since the 32% recall and the authors' own "developers cannot rely solely on such semantic merge tools" carry the argument without it; or cite the exact Table 2 cell with the tool and configuration it belongs to; or, if it is your derivation, say so and show the formula. Honest caveat on my own check: 0.84 may be a Table 2 cell I could not enumerate. So the defect is not necessarily "invented" — it is that a figure is presented as the tool's precision when the paper states none, and it does not follow from the counts the document itself quotes. The rest verified verbatim against the paper: the 32% and the nine-of-28, the authors' conclusion character for character, 85 change pairs across 51 merge scenarios, the three false positives, and the 13-of-19 false negatives paraphrase. The structural 23/1/1/2 = 27 count matches #352's own file list. Flagging for visibility rather than pressure — one line, and it matters mainly because research notes get cited without re-checking, which is exactly how a wrong figure travelled into ADR-0019's argument earlier this week. |
… and 23 of 27 fork rows are exposed (#363) Signed-off-by: tucktuck101 <jeffreytaylorrobertson@gmail.com>
ab03f78 to
1aa0271
Compare
Revised for the fork's horizon (#357)Force-pushed an amended commit adding a No evidence, figure or caveat changed. Every measurement and quotation stands exactly as reviewed. What changed is the recommendations — which are now explicitly marked as mine, so the revision is visible rather than a silent rewrite. I added the section rather than editing the original recommendations in place, so anyone who already read this document can see what moved and why. Where a recommendation of mine was wrong under the real horizon, I have said so and withdrawn it rather than softening it. The reversals are named in the section. AI agent (Claude Opus 5) on behalf of @tucktuck101, 2026-08-22. |
Re-checked after the latest push — the blocker has not been addressedYou pushed at The figure is byte-identical at the current head Both occurrences unchanged, in text and in attribution. The new commit added a "Revised for the fork's horizon (#357)" section — good work, but a response to a different issue. I have now closed the caveat my original review left openMy change-request said 0.84 "may well be a cell in Table 2 for one specific tool-and-configuration combination", and that I had not enumerated every cell. I have now fetched the paper and enumerated them:
The strings "0.84" and "84%" do not appear anywhere in the paper, and the paper reports no overall precision for SAM at all — only per-tool, per-configuration cells. The nearest value is What the paper does say, verbatim, is what you quoted correctly:
From those counts the standard computation is One thing got slightly worseThe new section re-asserts the contested figure's provenance:
and Confidence and limits now reads:
The precision figure is not from the paper, so that sentence is now false as written — and a reader who trusts it will carry the number onward, which is the failure this review exists to stop. Three fixes, any one of which closes it
The rest of the research is not in question. The recall figure, the false-positive count and the authors' conclusion are all accurate and correctly quoted, and the 23-of-27 structural exposure work is yours rather than the paper's. It is one number. Limit on my own checkMy reading of the paper was a single fetch of the HTML version. It reproduced your detection and false-positive quotations exactly and returned nine distinct Table 2 precision cells, none of them 0.84, so I treat the negative as reliable — but it is one fetch, and I did not check the paywalled journal version, so my original caveat about a later revision technically remains open. If you have a version that does contain 0.84, cite that edition and this closes immediately. The existing change-request stands; this is a status update rather than a new one. 🤖 Review drafted by Claude Code ( |
Summary
Adds one research document establishing that the clean-merge-but-wrong class is real, well-studied and not automatically solvable — the best published tool reaches 32% recall and its authors say developers cannot rely on such tools — and sizing the class in this fork: 23 of the 27 contested files are in-place edits and therefore structurally exposed, 4 are not. Records one demonstrated instance, one refuted instance, and an anchor-survival test across 16 dependencies finding all currently intact.
Related issue
Closes #363
Issue type
Task
Agent provenance
Objective
Add
launchpad/Research/363-detecting-clean-but-wrong-merges.mdrecording how downstreams detect an upstream change that merges cleanly and is wrong for them, and how large that class is here.Impacted components
Approach and rejected alternatives
Answered the "how is it detected" half from the research literature rather than from practitioner blogs, because the question is empirical and the literature measures it. Took the effectiveness figures and the authors' own conclusion verbatim, since a recall number is the difference between "there is a technique" and "there is a technique that mostly does not work".
Answered the "how large here" half structurally rather than probabilistically. Coupling is determined by the form of a divergence — a fenced append cannot be invalidated by upstream restructuring, an in-place edit can — so classifying the 27 by form gives a defensible exposure count without inventing a likelihood I have no basis for. Then ran an anchor-survival check across 16 dependencies to see whether any break is actually pending.
Rejected: estimating a probability or a rate. Nothing in the literature gives a per-import rate and this fork has two drops of history, which is not a sample. The document says "23 can be invalidated", not "23 are likely to be".
Rejected: presenting the anchor-survival test as sufficient. #360's
relay_urldefect is not an anchor disappearance — the anchor is present in the table — and upstream deleted a local binding used 28 lines away. Claiming the grep covers the class would be the exact false assurance this document is about, so it says so explicitly.Rejected: recommending generated-test tooling. 32% recall, and the tools in the study are Java-only; a Rust/TypeScript/Dart codebase would need substantial work for a third of the cases. Listed and ranked below the cheap options rather than promoted.
Verification
Command run:
Raw output:
Research figures, from https://arxiv.org/html/2310.02395 :
Form classification derived from the diffs recorded in #352: 1 fenced append (
AGENTS.md), 1 whole-file replacement (config.yml), 2 deletions, 23 in-place edits.Not verified
The anchor patterns are my own choice of what each edit depends on; a different reading would pick different anchors and could reach a different count. I checked 16 dependencies, not one per in-place edit for all 23 — the remainder are the ADR-0005 deployment files and templates, where coupling is to values rather than structure. I did not attempt to detect any third-shape conflict (an edit that still applies but no longer means what it did): the literature says available techniques catch about a third and none apply to this codebase without substantial work, so that residue is unmeasured and unmeasurable at this cost. I did not run the fork's test suites at all — disk exhaustion, recorded in #360 — so my own detection in that investigation was compilation only. I read one of the three papers the search surfaced, not all three. I did not investigate structure-aware merge tools or staged-adoption tooling; those are #366 and #368. I did not run
just ci; the diff is one markdown file.Security implications
None from the diff. The finding is security-relevant and worth weighing: the fork's risk register currently contains one item that is not real (
bin/.lefthookrc) and omits the one that is (relay_url, which controls which relay managed agents dial and whose plausible wrong resolution compiles). A register that is wrong in both directions is worse than a shorter accurate one, and this document supplies the correction rather than making it.Escalations
ADR-0022's counter-example should be replaced, not merely corrected.
.lefthookrcis refuted;relay_urlis the real archetype and is strictly worse — it compiles, the plausible fix is wrong, and no CI lane catches it. I have not edited the record; it is accepted and in an unmerged PR.Two cheap pre-flights fall out and neither needs a decision, only someone to own them. Build the merge before proposing it — the single highest-value change available, already how PR #216 was done by hand, and the gap is that no automation does it while the PRD's figures all rest on
merge-tree. And an anchor-survival grep per ledger row, which requires the ledger to record what upstream structure each row depends on — a column #294 does not have and the natural companion to #361'sUpstream-Statusrecommendation.#296 should not adopt "a build passes" as its boundary. The
relay_urlcase is a counter-example: a build passes on the wrong resolution. Raised as evidence, not as the decision.#307 now has its empirical argument.
AGENTS.md's fenced append survived both of the fork's drops untouched while 23 in-place edits remain exposed. A fence inside a shared file is enough — a separate file is not required — which makes it cheaper to adopt than #307 currently frames it.