If I remember the old posts correctly, it's the first building listed in the UNIT_PROD file that provides the valor bonus when upgraded to Master level. No bonus if Master level is required to build the unit, and Royal buildings (needed for Knights) don't really have a "master" building - so Knights don't get a valor bonus for buildings, only provinces.
In the examples you gave, Caravel, the JI get a bonus for Master Swordsmith, and Futuwwa for Master Boyer. That's what has always worked for me.
Bookmarks