Goryakuso is a ceremony conducted during pre-modern periods, in which a Year calendar is presented on every November first (old lunar calendar) by Onmyoryo to the Emperor via Nakatsukasasho.
An article on calendar making given in the Zoryo (Law on Miscellaneous Matters) of the Yoro Ritsuryo Code stipulate that Onmyoryo (more concretely Rekihakase) should make beforehand a New Year calendar and submit it to the Nakatsukasasho on every November 1st and that the Nakatsukasasho should present it to the Emperor. And that a calendar should be distributed to each official before the current year ends and the ceremony is conducted according to this rule.
According to the "Seiji yoryaku" published in the Heian period, two copies of guchureki and one copy of shichiyoreki were presented to the emperor (the Goryakuso ceremony was conducted to on the New Year's Day for the shichiyoreki because it was presented after New Year's Felicitations to the emperor) and two copies of guchureki were presented to the chugu and togu. Besides that, 166 copies of hanreki to be distributed to the government official and the provinces were also presented. Since a new guchureki was published every half year (therefore two new calendars per year), it is considered that a copy of guchureki was made for emperor, chugu and empress. As for hanreki, there are two widely-held explanations: one alleging that the calendar was published twice a year and eighty-three copies were distributed, like guchureki (explanation held by Toshiya TORAO and Hideo HIROSE) and the other alleging that the calendar was published once a year and 166 copies were distributed (explanation held by Hidesaburo HARA and Katsuaki YAMASHITA).
Onmyoryo informed, by every May first and via Nakatsukasasho, the related officials of quantity of materials necessary for making the calendar of the next year. Writing paper, ink and brushes were supplied by Zushoryo, shusa by Kurododokoro, and shafts by Mokuryo. The books related to the calendar, made by Rekihakase, were submitted to the Onmyoryo by June twenty-first and August first respectively for Hanreki and Guchureki (and for shichiyoreki by December twenty-first). The Onmyoryo established Onkoyomidokoro, a temporary specialized department to make calendars, where, once the books were submitted, are prepared for the day of calendar distribution by presenting calendars to the Emperor. According to "Dairishiki" (Ceremonial Book of the Court) and "Jogan gishiki" (ceremony in the manner of Jogan period), on the day of the presentation of the calendar, the emperor arrives at the Shishinden, the Minister and Secretary of the Ministry of Central Affairs steps forward to the court of the Shishinden, followed by Onmyo no kami and suke shouldering a desk carrying the guchureki and by Onmyo no jo and zoku shouldering a chest containing the hanreki. When officials of the Onmyoryo leave the court, the suke makes a presentation before the emperor on behalf of the Ministry of Central Affairs, the guchureki is presented to the emperor, the hanreki is distributed to the Shonagon who manages communications between the Emperor and the Daijokan, then it is sent to each minister, then distributed by ministers to each government officials and kokufu via benkan and, if the number of copies are not enough, highly-ranked kanshi or kokufu transcribes it and sends it to low-ranked kanshi or gunji (district official). Besides that, calendar presentation was made separately to chugu and togu by Onmyoryo and similar treatment was sometimes given to junsangu (according to "Teishin koki-sho Extract"). At the beginning, rekihakase participated only in making calendar books and were not involved in the onkoyomidokoro and goryakuso, but from the late ninth century, he began to participate in goryakuso together with Onmyo no kami and suke (according to "Nihon Sandai Jitsuroku" dated on December 4, 886).
But sometimes San hakase and Sukuyoshi protested a new calendar presented to the emperor and engaged in a dispute over amending the calendar and it was not uncommon to see the calendar amended (the new year calendar modified or changed) after the New Year Day. The mechanism of the goryakuso itself died out as the ritsuryo system faded. Kamiyain, who had been making paper in Toshoryo, had difficulty making paper because of the shortage of material, and therefore, began to make recycled paper called shukushi, and this made it difficult for Toshoryo to supply good quality paper for calendar to Onmyoryo. According to the "Seikyuki," a book supposed to have described the court and samurai rules of ceremony and etiquette in the latter half of the 16th century, the number of copies of hanreki to be presented to the emperor was 120. But this was a quasi-ideal number and in fact, in the goryakuso in 941, the emperor was not present and only eleven copies of the calendar were presented, and in the goryakuso during 993, Sakutantoji was not celebrated, no copies of the calendar was presented to the emperor and no chest arrived at the court (each according to "Honcho seiki"). Hanreki was originally a calendar to be distributed to government offices, nobles and monks made it a practice to ask rekihakase or rekisei to make or transcribe guchureki in order to write their own diary (on this point, it is known that FUJIWARA no Sanesuke ordered calendars to an onmyoji (practionner in the Onmyoryo) by paying for paper and paid one hiki of silk when the calendar was completed (according to the article of "Chuyuki" (diary written by FUJIWARA no Munetada) dated on October 2nd, 1014) and the line of regents and advisers made it rule that rekihakase presented guchureki to them (according to "Gonijo Moromichi ki" (The Diary of FUJIWARA no Moromichi), "Denryaku" (The Diary of FUJIWARA no Tadazane) and ''Gyokuyo" (The Diary of Kanezane KUJO)). It is thought that the same practices were carried out for the emperor, too. Later, when insei period started, people made it rule to present three copies of the calendar to kanmu and kyokumu and one copy to kirokujo in the year of sakutan toji (according to "Chuyuki" by FUJIWARA no Munetada in 1126, "Einin gonen sakutan tojiki" by Kamo no Sadakiyo in 1297 and "Daigeki morotoyoki" by Morotoyo NAKAHARA in 1392). Besides that, Kamo clan, who had been taking over the post of rekihakase by succession in the government office contract system since the Heian period, thanks to its tradition and its experience, began to claim that goryakuso was its exclusive right and began to get the emperor to agree not to involve Abe clan in goryakuso even if they were Onmyonokami (according to "Heikoki" by TAIRA no Tsunetaka on December 5 and 13, 1240). Even in such a situation, FUJIWARA no Yorinaga and Iezane KONOE renewed the tools and took measures to encourage calendar-making, but this ended up as a temporally solution, and the record on the last goryakuso is an article in "Yasutomi ki" on November 21, 1449 who said: the number of copies for kanmu and kyokumu were reduced to two, respectively. Since no record existed of the goryakuso in 1468 and the last sakutan toji was carried out at Shoshu (the merit of carrying out goryakuso at the sakutan toji disappeared), it is thought that goryakuso was abolished due to the Onin War that broke out the previous year.