Do Buddhist texts record or comment on the then-prevalent varna or caste systems? Do Buddhist ancient scriptures/texts record or comment on: 


The then-prevalent varna system?


or


The then-prevalent caste system (clan-like system)?


I understand that Buddhism is based on equality, i.e. I am not saying that Buddhism accepted the caste system.
In particular, what I am asking is whether buddhist text:


Records any wrong-doings based on caste system or varna system
Records whether or not the varna system was birth-based at that time
Explicitly says that it rejects birth-based varna system/caste system.


Please provide references from such text.
Straight forward answer is Buddhism never accept caste system or the color. In "Wasala suthra"  (as I remember the name) Lord Buddha has clearly mentioned that, a person doesn't become noble by his birth, caste etc but by his act (behavior). 

Vasala Sutta: Discourse on Outcasts (SN 1.7)


  Now at that time a fire was burning, and an offering was being prepared in the house of the brahman Aggikabharadvaja. Then the Blessed One, while on his alms round, came to the brahman's residence. The brahman seeing the Blessed One some way off, said this: "Stay there, you shaveling, stay there you wretched monk, stay there you outcast." When he spoke thus the Blessed One said to the brahman: "Do you know, brahman, who an outcast is and what the conditions are that make an outcast?" "No, indeed, Venerable Gotama &hellip;