Attacks are also not merely limited to things that require an attack (or even a full attack) action. The rules on breaking invisibility makes that point clear.
You can't generalise a definition of what an attack is from the Invisibility description; the spell specifies that it uses an idiosyncratic definition.
"
For purposes of this spell, an attack includes any spell targeting a foe or whose area or effect includes a foe."
The definition of 'attack' used by the Invisibility spell is different to the definition of 'attack' used by the Magic Overview section, which is different to the definition of 'attack' used by the Combat section.
The word 'attack' has many meanings.
Magic Overview says:
Attacks: Some spell descriptions refer to attacking. All offensive combat actions, even those that don’t damage opponents are considered attacks. Attempts to turn or rebuke undead count as attacks. All spells that opponents resist with saving throws, that deal damage, or that otherwise harm or hamper subjects are attacks. Spells that summon monsters or other allies are not attacks because the spells themselves don’t harm anyone.
So for the purposes of the Invisibility spell, Detect Magic cast such that the area includes a foe is an attack, and will break Invisibility. However, since it is not an offensive action, does not deal damage, harm, or hamper subjects, and is not resisted with saving throws, Detect Magic is not an attack for the purpose of other spell descriptions - it will not break a Sanctuary spell, for example.
And while the Detect Thoughts spell, which opponents resist with a saving throw, is an attack by the definition of the Magic Overview (and will thus break a Sanctuary spell), it is not an attack by the definition of the Combat chapter.
The section in the RC (or Complete Arcane) takes about weaponlike spells and thus ties them into being like weapons for most purposes.
A ray is only a weaponlike spell if it a/ requires an attack roll, and b/ deals damage (in the form of hit point loss, ability damage, or negative levels).
Ray of Frost is a weaponlike spell. Ray of Exhaustion is not. However, Ray of Exhaustion requires a ranged touch attack.
If your contention is that Ray of Frost, by the rules, provokes a second AoO
because it is a weaponlike spell, then Ray of Exhaustion does not, because it is not a weaponlike spell.
However, if we assume that Ray of Exhaustion requires making a ranged attack (even though it is not an attack with a ranged
weaopn, like Ray of Frost might be considered to be), Ray of Exhaustion might still provoke the second AoO, under the rules in the PHB that ranged attacks provoke.
-Hyp.