Now the way-too-detailed explanation of 更衣. The characters in that name are literally "change clothes." This whole section has a lot of quotes from sources that have no commentary or modern translation, so my translations may not be completely accurate.
Kogetsusho shisetsu (1673): The term 更衣 is used because they assist the Emperor in changing his clothes in the chambers. In the Chronicles of Han, in the biography of Guan Fu, an annotation by Yan Shigu says: "更 means 改 [change]. Generally when people sit for a long time they arise and change their clothing." Also in the biography of Empress Wei, it says: "Emperor Wu arose and changed his clothing. Zi Fu assisted him."
In our court, the beginning was during the reign of Emperor Ninmyō, in the third year of the Jōwa era . Ki no Otouwo (紀乙魚) of the fifth rank was raised to the sub-4th rank and made a koui. The Kakaisho explains this in detail. The Sairyusho says: "They are the daughters
of high-ranking noblemen making them fit to serve in the appropriate chambers."
The Chronicles of Han is the second of the official Chinese histories, covering 206 BC to 25 AD. There is no Japanese edition of this work (other than some Edo-period woodblock prints) so I am very tentative about the accuracy of my translation of that part. The second quotation about the Empress Wei comes from the Shi ji, the first official history of China. Zi Fu is the real name of Empress Wei. The third quotation is apparently from the Shoku nihon koki, but the edition of that work I looked at says nyougo rather than koui. I'm also not 100% sure of my translation of the Sairyusho passage.
Shinshaku (1758): Koui are the equivalent of today's hin. The term appears in the chronicle of Emperor Ninmyō, and the kanji are also in the Chronicle of Han (cites omitted). Also in the biography of Dongfang Shuo it says: "A place of rest where they change clothes. There is also a palace person here." Therefore koui is also called miyasudokoro. However, a woman who is not a koui is called a miyasudokoro if they bear a Prince, and the Empress of the Crown Prince can be called a miyasudokoro as well. In this work, koui is simply replaced with miyasudokoro after the woman bears a child. The Crown Prince's Empress is a miyasudokoro from the start.
The Dongfang Shuo quote is once again from the Chronicles of Han; I'm not even certain of the kundoku, much less the translation. I've located these passages in the Chronicle and there is a modern Japanese translation, so it's possible I could check that.
The issue of the term miyasudokoro is a long-standing one; the commentators are attempting to reconcile the way the term is used in the Genji with the way it is used in some other texts (like the Eiga monogatari) where it seems to be just a synonym for koui.
A different manuscript of the Shinshaku, after "Therefore koui is also called miyasudokoro," says this: "Generally, an Empress can be called oomiyasudokoro, and the Empress of a Crown Prince can be called miyasudokoro, and also someone who has borne a Prince can be called miyasudokoro. In this work, a koui is called miyasudokoro after bearing a Prince."
This seems doubtful. Perhaps this is based of off the Ise monogatari or the Rokujo Haven from this work, but it seems like a forced theory. The Tama no ogushi's theory is good.
The theory in the TO occurs later, when the word miyasudokoro occurs in the tale -- in short, Norinaga says that any woman, regardless of rank, who bears a child to an Emperor or Crown Prince is called miyasudokoro.
Well then, the Tamagatsuma says: "The Shoku nihon kouki says: 'In the 9th year of the Jōwa period , the first month, hinoe saru tsuchinoe inu: On this day, an imperial order was given to raise Asashino Takako from the sub-5th rank to the 5th rank, and Yamato no Sukune Chikako was given the sub 5th rank. They are both koui of the Retired Emperor." In what reign did the koui begin? This seems to be the first recorded instance of the term. Originally the Offices of the Palace Women says: "Two hi, who are above the 4th rank. Three fujin, who are above the third rank. Four hin, who are above the 5th rank." But after this, those terms fell out of use and generally nyougo were the older hi and fujin, and koui were the older hin. In the Sandai jitsuroku it mentions the "koui of Emperor Kōkō", and in the 3rd year of the Jōwa period , "An imperial decree made the koui Fujiwara Motoyoshi, fifth rank, into a nyougo. She was the daughter of the Middle Counselor sub-3rd rank Yamakage."
I'm not up to finding out how "hinoe saru tsuchinoe inu" translates into an actual date, sorry. The Offices (令) is a number of texts that describe a basically Nara-period system heavily influenced by Chinese example. The Shin nihon kouki and the Sandai jitsuroku are the 4th and 6th official national histories, respectively.
清涼殿記に、「更衣 （其ノ員十二人以下其ノ数ニ満タズ） 尚侍、諸司ニ宣下シメ、禁色ヲ着ス」などいふことも見えたり。
Also, The Seiryōden Chronicle says: "Koui (there can be fewer than twelve) following a decree from the Mistress of Staff, can wear the forbidden colors."
河 延喜ノ御代ノ后宮：女御五人、更衣十九人、中宮以下都合二十七人なり。桐壺帝ノ后宮実名露顕の分：女御三人 承香殿（四宮ノ母） 麗景殿（花散里ノ姉） 一人（八宮ノ母） 更衣二人 桐壺 後涼殿 后二人 大后（弘徽殿） 女院（藤壺） この物語に書のする所七人なり。
Kakaisho (1360's): The palace women in Emperor Daigo's court: 5 nyougo and 19 koui, a total of 27 women below the Empress. Women in the Kiritsubo Emperor's court whose names are given: Three nyougo (Jōkyōden, mother of the Fourth Princess; Reikeiden, Hanachirusato's older sister; and the mother of the Eighth Prince). Two koui (Kiritsubo and Kōryōden). Two Empresses: the Empress Mother (Kokiden), and the Empress (Fujitsubo). A total of seven.
The part about Daigo's court is the usual historical parallel, which should not be taken too seriously.
The older commentaries had a great interest in relating the Genji to historical people and events; Hagiwara accepts that these parallels exist in some fashion but encourages viewing the story primarily as fiction.
Phew, that's finally the end of the first sentence. Fortunately most of the passages don't have this level of annotation.