I am reading this page on Le Robert:
Cas particulier: C'est nous qui l'avons fait (et non *nous qui l'ont fait.) Lorsque qui a pour antécédent un nom ou un pronom qui est attribut du sujet de la proposition principale, le verbe de la subordonnée s'accorde obligatoirement avec l'attribut lorsque
Why is it not "... est l'attribut du sujet de..."? Attribut is a count noun if I am not mistaken and I am not aware of an adjectival form. Why doesn't it need a definite article? Also another page has:
La fonction d'attribut est occupée par un terme qui, par l'intermédiaire d'un verbe dit « attributif » (autrefois appelé « verbe d'état »), sert à préciser l'une des caractéristiques
Similarly why isn't it de l'attribut?
By the way I also don't quite understand the lorsque at the end of the first sentence. Is "attribut lorsque" is a noun phrase? If not what is lorsque doing bringing up the rear?