Here is what I have so far. Although it still has the issue if a pact is made with the same alliance type you get the corresponding pact bonus whether it has been researched or not by your ally. I wish pacts weren't locked down to the three races as I really wanted to add on two new races with unique pacts.
My other option is to go back to reusing the existing pacts which isn't nearly as fun.
Engish.str - Modified base pact names to be generic.
StringInfo
ID "IDS_RESEARCHSUBJECT_PACT_TRADE_NAME"
Value "Diplomatic Pact"
StringInfo
ID "IDS_RESEARCHSUBJECT_PACT_TRADE_DESCRIPTION"
Value "Two factions agree to share secrets, mutually improving both empires."
English.str - Renamed existing pact id's to be IDS_RESEARCHSUBJECT_PACTUNLOCK_[pact]_NAME.
StringInfo
ID "IDS_RESEARCHSUBJECT_PACTUNLOCK_TRADE_NAME"
Value "Trade Pact"
StringInfo
ID "IDS_RESEARCHSUBJECT_PACTUNLOCK_TRADE_DESCRIPTION"
Value "Two factions agree to share trade secrets, mutually improving trade income rates for both peoples."
Modified existing research subject entities to reference new ID's.
RESEARCHSUBJECT_PACTUNLOCK_TRADE.entity
NameStringID "IDS_RESEARCHSUBJECT_PACTUNLOCK_TRADE_NAME"
DescriptionStringID "IDS_RESEARCHSUBJECT_PACTUNLOCK_TRADE_DESCRIPTION"