**TL;DR**: During my PhD, I developed a data analysis code that became significant within a Huge Science Collaboration. Despite agreements that I would be credited in publications using my code, I often was not, and others, especially a collegue, received primary credit. Attempts to address this with my former PI were only partially successful, and I fear my contributions will be overlooked as the code and related papers are released. I’m frustrated and seeking advice on ensuring proper recognition.


----------


During my PhD (Sep 2016 - Dec 2020), I developed a code for data analysis. My PI always pushed me to write it, and I did so gladly, even though he always thought that the code would remain a private code within the research group.

I used this code to get results that were published in a few papers, but no official paper for the code exists. However, during my PhD, I used my code also for some benchmarks for a Huge Science Collaboration (hereafter HSC), and it started to gain some traction.

At the end of my PhD, I decided to leave Academia, and therefore I started to hand my code over to other people in PI's research group, so that the code could be expanded after I left. In particular let's call one of these people X.
Here, I think I made a mistake: since I was the only person working on the code, I just had it on my computer. When I handed it over, the code was placed on a (private) git repository owned by X.

My understanding was that, whenever the code were used in a research paper, I would at least be offered authorship of the paper (this happened also for other resources I used in my papers, where people creating the resources were offered authorship of my first-author papers, even though they did not work on them at all).

At some point, since the code was gaining attention, PI's group decided that it would have been good to release it to the public. I was okay with it, as long as the former condition remained in place, and as long as I were at least referenced (through my papers) as one of the authors of the code.

Another agreement reached later was that, when releasing the code, there would be a science paper accompanying it, with X as the first author (since X would perform the main science analysis) — let's call this paper X1 — and that I could later write a paper as first author detailing the technical aspects of the code.

Then, all hell broke loose.
I asked my (now former) PI to keep me in the loop, since I still wanted to be involved with research in my spare time. This almost never happened, apart from some very technical details on which I was more experienced.

There were papers in which the code was used, and in the best case I was merely acknowledged as a person that gave "help with the code" (and in other cases I was not even mentioned). I complained with PI about this, but nothing changed.

In the mean time, X changed research group, while staying in contact with PI's research group. X published a first-author paper with their new research group using the code -- let's call this paper X2 -- and nobody else from PI's group was included or referenced in the paper for the work on the code. 

Recently, X also won a position to work on the code, in close contact with PI's group.

And now, some HSC official papers are coming out.

In one paper, the code was used. X was one of the first authors, and PI was an author as well. The code was used, paper X2 (the one with the other group) was referenced as the main paper for the code, while my papers were referenced as "validation" of the code.
I complained with PI, reminding them also the agreements about future paper X1 and my future paper. The answers I got were that "X is the person now working on the code and advertising it", and "we cannot reference those papers since they have been in preparation for too long now" -- as well as, between the lines, "you are not in Academia anymore, you don't really need this, why do you care?". I complained also for the fact that paper X2 does not involve anyone from PI's group, which is unfair for all the people in PI's group that worked on the code. We agreed that a solution would have been to reference, along with X2, my old, already-published papers, as long as papers from other people in PI's group that worked on the code. This was corrected in the final version of the paper.

In another HSC paper (where both PI and X are authors), I was offered authorship, and the references to the code were correctly placed.

Now more official HSC papers -- where both PI and X are authors -- are coming out: still, either paper X2 is referenced as the *only* reference to the code, or my old papers are still referenced as just "validation" of the code.

And as of today, the code is still unreleased.

I'm now exhausted. I see the code as my main contribution to Science, especially since it is now being used in HSC, and also because I will not likely be able to do any more science. But I'm not being credited appropriately, meaning that, sooner or later, my only proper contribution will be credited to someone else entirely, which is frustrating. Yes, X worked on the code. Yes, X's contribution to the code has been as valuable as any other person's contribution. But I also think that other people's contributions should not be minimized and should be recognized as well.

Now, it seems that the code will be released soon, as well as infamous paper X1, while my paper on the technical details of the code will likely never see the light (I no longer have the time nor the will to work on this with PI's group). And my fear is that for paper X1 (which has been in preparation since before my PhD defense, and my contributions to it were included in my PhD thesis) I won't be even included as an author. 

Am I overreacting? Is it too much to ask to get credit where credit is due? Is there anything I can do? Any advice?

**UPDATE**: I just wanted to clear up a few points that emerged after the first answers arrived.

Blocking the group's work was never my intention. After my PhD, I handed my code over without any issue whatsoever. I was actually glad that my work could be expanded on.

All I expected was fairness. I mentioned being offered authorship, but to be clear, it was never my intention to accept it. My PI always gave me the impression that offering authorship to people (even if only slighlty involved) was a courtesy. I expected the same level of courtesy, but as I also later cleared up with PI, it was never my intention to accept it. And after that, I also never expected any offer of authorship.

I never wrote a scientific paper on the code. The point is that the code is just an implementation of the workflow. PI always intended for the workflow to be important, and the implementation to be useful, yet circumstantial. After my PhD defence, when the idea of releasing the code came out, my intention was to write a scientific paper, but could never find the time. Sadly, I think that cooperating with my former group, right now, is not an option.
In any case, paper X2 is not a scientific paper on the code either, so it shouldn't have more privileges than other papers in being referenced as a paper of the code.

I know that with time my contributions will be forgotten, but being forgotten was never the problem; my efforts being credited to someone else, is.