Hmm. You might consider adding the "restricted" tag. But it's kind of hard to say; you might want to have a look through BaseSubmarketPlugin.addShips() to see how it works and see what you might not be accounting for as far as its behavior.
Yeah I was thinking that as well, but looking at the plugin - it is generating a dummy fleet based upon faction doctrine - which presumably follows that if the faction doesn't know the ship, it wouldn't be included in the faction doctrine. However, it is doing this by variant id in some places rather than hull id. So possibly I'm missing a variant override so its being included in the doctrine that way?
Even still, however, once the dummy fleet is created the plugin iterates through each fleet member and checks for:
if (member.getHullSpec().hasTag(Tags.NO_SELL)) continue;
- so it shouldn't be used if it has that tag. Which all of them should.
At this point I'm a little at a loss as to what could be going on. I'll have to check each submarket plugin too in case there are defaults there, or something.
Unless... hmm since the ship was in an independent market I wonder if it was using the mercenary faction's doctrine - which defaults to independent. Even though I remove the merc tag from everything, I don't actually know if I remove "knownShips" explicitly. That might be another lead.