arXiv:2611.07887cs.SENov 2026

Manuscript Offprint

arXiv:2611.07887

A Low Similarity Score Does Not Show Independence after Source-Conditioned Repository Rewriting

Micheline Bénédicte Moumoula, Serge Lionel Nikiema, Tailia Malloy, Abdoul Kader Kaboré, Jacques Klein, Tegawendé F. Bissyande

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

MICHELINE BÉNÉDICTE MOUMOULA*, University of Luxembourg, Luxembourg

SERGE LIONEL NIKIEMA, University of Luxembourg, Luxembourg

TAILIA MALLOY, University of Luxembourg, Luxembourg

ABDOUL KADER KABORÉ, University of Luxembourg, Luxembourg

JACQUES KLEIN, University of Luxembourg, Luxembourg

TEGAWENDÉ F. BISSYANDÉ, University of Luxembourg, Luxembourg

Maintainers sometimes cite a low token-similarity score as evidence that an LLM-assisted rewrite of a copyleft project is independent of the original. We test what such a score can support under source-conditioned rewriting: a coding agent keeps the original in its working copy, rewrites the repository, and iterates until a fixed behavioural harness passes, with no human edit to the code. On 69 rewrites of six copyleft Python projects we find that: ① Agent-only rewriting is inexpensive and often yields low scores. Every controlled rewrite passes the harness after repair, usually within half an hour for the initial rewrite. Under a ground-up rearchitecture prompt, most rewrites fall below 25% JPlag similarity and still pass the harness. ② A single low score is an unreliable witness. Identical project–agent–prompt configurations produce wide spreads in similarity; run-to-run variation dominates project and agent effects, and in more than a third of configurations the three repeats straddle the threshold. Rewrites retain more of the original's imports and fingerprint facts than unrelated projects do, yet hand-written independent implementations of the same task often retain as much, and neither signal separates the two groups better than chance. Thus a low score on one rewrite is weak evidence of independence: another run of the same agent may score high. Claims based on similarity should report repeated generations, and candidate provenance signals should be checked against same task independent implementations, not only against unrelated projects.

CCS Concepts: • Software and its engineering → General software creation; • Computing methodologies → Natural language processing.

Additional Key Words and Phrases: repository rewriting, provenance, clone detection, behavioural tests, open-source compliance, LLM agents

1 INTRODUCTION

In March 2026, version 7.0.0 of chardet, a widely used Python library for character-encoding detection, was released under the MIT licence after twenty years under the GNU Lesser General Public License (LGPL). Its maintainer presented the release as a ground-up rewrite produced with an LLM coding agent, and the original author objected that a rewrite by people exposed to the LGPL code remains bound by that licence [15]. In response, the maintainer reported that JPlag found a maximum similarity of 1.29% between the new release and the previous one [5, 26]. Without taking a position on that dispute, we observe that token-similarity scores have become the evidence offered when an agent-assisted rewrite is claimed to be independent of the original, which leaves maintainers, downstream users and licence auditors to decide what such a score is worth.

*Corresponding author (micheline.moumoula@uni.lu)

Authors' addresses: Micheline Bénédicte Moumoula, University of Luxembourg, Luxembourg, Luxembourg, micheline.moumoula@uni.lu; Serge Lionel Nikiema, University of Luxembourg, Luxembourg, Luxembourg, lionel.nikiema@uni.lu; Tailia Malloy, University of Luxembourg, Luxembourg, Luxembourg, tailia.malloy@uni.lu; Abdoul Kader Kaboré, University of Luxembourg, Luxembourg, Luxembourg, abdoulkader.kabore@uni.lu; Jacques Klein, University of Luxembourg, Luxembourg, Luxembourg, jacques.klein@uni.lu; Tegawendé F. Bissyandé, University of Luxembourg, Luxembourg, Luxembourg, tegawende.bissyande@uni.lu.

Detectors such as JPlug and MOSS [16, 20] were built to catch copying that survives renaming and reordering, and a low score has long been read as support for independent authorship. That reading has become harder to defend since LLM paraphrase was shown to lower token overlap while behaviour and structure persist [13, 14, 19, 31], and since coding agents extended rewriting to whole repositories, where they plan, edit files, run tests and repair failures with little supervision [8, 12, 28]. Existing studies cover parts of this situation without measuring it as a whole. Paraphrase studies evaluate detectors on methods and student assignments [14, 19, 31], memorisation and copyleft studies measure the leakage of protected fragments in short completions [1, 4, 30], and repository-rebuild benchmarks change the language or withhold the source and score behaviour only [7, 32]. None reports how similar a same-language, repository-scale rewrite is to its original, whether that similarity is reproducible from one run to the next, or how it compares with an independent implementation of the same task.

We measure these three quantities in the setting least favourable to a claim of independence, which we call source-conditioned rewriting, where the agent works with the original in its workspace. This choice bounds what a score can show, since a low score cannot rule out access to the original if rewrites produced with full access also score low. Under our protocol, an operator gives the agent a working copy of the project, pastes a rewriting prompt followed by a repair prompt, and then sends only Continue until a predefined behavioural harness passes, without ever editing the code. We apply this protocol to six copyleft Python projects with five agents from different providers, which yields 69 rewrites. Fifteen of them cross the five agents with three prompts of increasing structural change on one project, and the remaining 54 repeat the most disruptive prompt, which requests a ground-up rearchitecture, three times with three agents on each of the six projects.

This paper makes the following contributions.

  • We define an agent-only rewriting protocol that accounts separately for rewriting and for repair, and we release the 69 rewrites, their harnesses and all scores.
  • We show that rewriting is cheap, since all 15 controlled rewrites pass the harness after agent-only repair and the initial rewrite takes a median of 18 minutes. Median similarity is 64% under a layout-preserving prompt and 22% under the ground-up prompt, although this ordering holds for three of the five agents only.
  • We show that low similarity is common but not reproducible. Of the 54 ground-up rewrites, 42 score below 25% mean JPlug similarity, 34 of these also pass the harness, and six score below 5%, yet the nine rewrites of a single project spread over 14 to 75 percentage points. Repeating an identical configuration accounts for 61% of the variance, against 14% for the project and under 1% for the agent, and in 7 of the 18 project-agent configurations three identical runs fall on both sides of the 25% threshold.
  • We show that two signals which resemble provenance are not specific to the original. Rewrites retain 54% of the original's external imports and 48% of its fingerprint facts, which is 44 and 35 percentage points more than unrelated projects do. When rewrites are compared with independent implementations that we wrote for each project from a capability specification and the harness, their fingerprint advantage is positive on only two of six projects, and neither signal separates the two groups (AUC 0.45 for imports and 0.40 for fingerprints, with confidence intervals that include 0.5).

For practice, these results mean that a similarity score from one rewrite is a single draw from a wide distribution, so that a low value neither demonstrates independence nor guarantees that the next run will score low. They also mean that a candidate provenance signal must be compared with independent implementations of the same task, because a comparison with unrelated projects credits to the original what the task itself imposes.

References (16)