In the finale of Picard Season 3, the Titan, armed with a 100 year old cloaking device, manages to successfully evade detection by the Borg controlled fleet. This raises some questions. How on earth is it that the Titan was able to accomplish this with a seemingly obsolete cloaking device?
I postulate two things, the first is that what we call the cloaking device is merely one component in a whole system of invisibility, and the second is that StarFleet was certainly obeying the letter of the treaty (Pegasus and Section 31 aside) by not developing cloaking technology, but was, in reality, building ships ready to accept cloaking devices at a moment's notice.
What do we know about cloaking devices, and how are they defeated? The cloaking device ties into the ship’s deflector shield control (as per TOS: The Enterprise Incident) and it obtains invisibility in part by bending light around the ship (as per comparison to the Aldean planetary shield in TNG: The Bough Breaks and description from DISL Into the Forest I Go)
However, using the deflector shield to remain unobserved does not necessarily require a cloaking device. As per the opening of TOS: Assignment: Earth, the Enterprise was able to use its defector shield to remain unobserved to 20th century technology.
And there are countless examples of a cloaking device being imperfect. The most famous example is likely Star Trek VI: The Undiscovered Country, where a torpedo set to target ionized gas is able to trace down the location of a Bird of Prey, summarized as “The thing has to have a tailpipe.”
But that is not the only example. Detecting energy distortions, subspace radiation, high speed warp signatures from neutrino radiation, and looking for tetryon particles all worked as forms of passive detection. (I will not cover active detection mechanisms such as the tachyon net, as the Borg fleet never deployed them.)
To add to all this, the clocking device is very small. A device about the size and weight of a man can make a ship invisible.
Here I switch to speculation.
First, I suggest that the cloaking device is primarily a computer. It is not the thing which makes the ship invisible - you could plug it into a building and it would not work, unless it has its own projectors. It must be plugged into a ship with a deflector array, to enhance and perfect its ability to make the ship invisible.
Second, the quality of the ship is more important than the quality of the cloaking device. A cloaking device “merely” needs to look at all incoming radiation of all types, and calculate how to move it around the ship for total silence. But it cannot protect against a ship which emits radiation, leaks gas, etc. Thus, a ship designed with high quality shields and high quality emission control will be more stealthy.
Side speculation: The design decision to not use an antimatter core in the first Bird of Prey we see during TOS: Balance of Terror (their power is simple impulse only implies fusion) and the later TNG-era decision to use a forced singularity despite the downsides, may be rooted in the notion that the Romulans felt that emissions from antimatter annihilation were a liability. Selling the Klingons the cloak and not telling them about this problem seems entirely on brand for the Romulan Star Empire.
There is something of an exception here, the phased cloak. A ship out of phase would, presumably, emit radiation which is also out of phase. (Extrapolated from TNG: The Next Phase where Ro shoots Riker in the head and he does not notice.) The phased cloak represented an attempt to fix emission control on a completely new level. But the phased cloak had problems, and is is seemingly a dead end for the ability to fire while cloaked. Plus, research was a treaty violation.
So now we return to the Titan. We know that plugging a 100 year old cloaking device into the Titan produced an invisibility effect which worked admirably. StarFleet may have seemingly kept their commitment to not build ships with cloaking devices, but this was always a hand wave agreement. StarFleet was ready for the day when they needed invisible ships, and having ships ready to accept cloaking devices was seemingly an unspoken but very intentional design consideration.
When the Titan needed to be invisible, she was missing only one piece of the puzzle.
I am admittedly basing this on The Next Phase, where Ro and Geordi stay phased without anything keeping them phased, and where Ro shoots Riker point blank in the head with a phased disruptor, and he feels nothing.
But now that you mention it, we would need to reconcile that, of course, with the fact that the Pegasus dropped back into normal phase when the cloak failed.
I had not considered a torpedo with an integrated rephase module. Maybe this could work (and there would be great value in a torpedo that phases back after passing through a shield bubble) but we don't commonly see torpedoes with deflector grids, cloaking devices, etc.
But I would concede there could be some interesting research here. However the Federation might decide not to advance it anyway as it's very clearly a treaty violation, whereas "ship that has good emissions controls and a finely tuned deflector grid" is not.