DOING PUBLIC NEEDS ON CHOL HA'MO'ED
Gemara
2a (Mishnah): On Chol ha'Mo'ed we may fix roads, Rechovos, Mikva'os and all public needs. We mark off graves and go out to destroy Kil'ayim.
4b - Abaye permitted people of Bar Hamrach to be Shochef a river. R. Yirmeyah permitted people of Sukosah to open the source of a stopped up river.
Rav Ashi permitted people of Masa Machsiya to dig out the river Bornitz. Since people drink from it, this is a public need, and the Mishnah permits all public needs.
5a (Beraisa): We may remove thorns from roads, fix Rechovos and Istartiyos, measure Mikva'os and complete the Shi'ur if needed. If they did not do so, they are responsible for any resulting casualties - "V'Hayah Alecha Damim"!
6a (Mishnah): On Chol ha'Mo'ed we go out even for Kil'ayim (to get rid of it).
Contradiction (Mishnah): We announce about Shekalim and Kil'ayim on Rosh Chodesh Adar... On the 15th we remove thorns from the roads, fix Rechovos, measure Mikva'os and do all public needs. We mark off graves and go out for Kil'ayim.
Resolution #1 (R. Elazar or R. Yosi b'Rebbi Chanina): We go out in Adar for early crops, and on Chol ha'Mo'ed for late crops.
Resolution #2 (the other of R. Elazar and R. Yosi b'Rebbi Chanina): We go out in Adar for Zera'im (crops grown to eat the seeds, such as grain) and on Chol ha'Mo'ed for Yerakos (crops grown to eat the growth).
(R. Yochanan): We go out for Kil'ayim on Adar 15 or Chol ha'Mo'ed if it did not blossom (before). If it blossomed, we go out (immediately).
Question: Why do they go out particularly on Chol ha'Mo'ed?
Answer (R. Yakov): It is cheaper to hire workers then.
Inference (Rav Zevid): This shows that the workers are paid from Terumas ha'Lishkah. If the owners of the Kil'ayim would have to pay, we would not be concerned for saving them money!
Rishonim
The Rif and Rosh (1:7) bring the Beraisa which says that we may remove thorns from roads, fix Rechovos and Istartiyos, measure and complete Mikva'os... and if not, they are responsible for any casualties
Nimukei Yosef (DH u'Metzayenim): It is permitted to mark off graves because it is not a great exertion.
Nimukei Yosef (DH Istartiyos): (We may fix Rechovos and Istartiyos). Istartiyos are markets. Rechavah is where we give the first meal after the burial to an Avel.
Note: The Aruch and Rashi (Eruvin 26a) say that Istartiya is a king's path or a yard in back of the palace. Rashi (Eruvin 7a) says that Rechavah is a yard in back of houses.
Nimukei Yosef (DH u'Minayin): The Beis Din of the city is responsible for the casualties.
Ra'avad (brought in Rosh 1:6): The people of Masa Machsiya had few pits and limited water. It was a great exertion to draw water from the river. They dug out of the riverbank to make a channel for the water to flow to the city, to make water abundant. Even though it was a great exertion and done overtly and it was left to be done on Chol ha'Mo'ed, it was permitted, because this is the only time that public needs get done, for people do not work then. The Yerushalmi says that in Sukosah the bathhouse collapsed, and it was permitted to fix it, even though it was a great exertion and they planned to do it on Chol ha'Mo'ed. It seems that these were not needed for the Mo'ed, nevertheless they were permitted.
Question: Why is this different than digging pits for the Rabim, which is permitted only if needed for the Mo'ed?
Answer (Ra'avad): Digging pits is a Ma'aseh Uman (they must be plastered professionally to hold the water). If a Shinuy is used, there will be a loss. Therefore it is permitted only if needed for the Mo'ed. The above cases were Ma'aseh Hedyot, therefore they were permitted even though they were not needed for the Mo'ed.
Rambam (Hilchos Yom Tov 7:10): We may do all public needs on Chol ha'Mo'ed. We may fix roads and Rechovos. We remove thorns from the roads and measure Mikva'os. If a Mikveh is found to be deficient, we direct water into it to complete the Shi'ur.
Rambam (Hilchos Kil'ayim 2:15): On the 15th of Adar, Sheluchim go to check if people got rid of Kil'ayim.
Rambam (17): The Sheluchim go again on Chol ha'Mo'ed Pesach to check for Kil'ayim in the late crop.
R. Chananel (DH Aval): If Kil'ayim blossomed, we go out immediately; we do not wait for Chol ha'Mo'ed. After it was enacted to make the entire field Hefker, we do not wait for Chol ha'Mo'ed.
Me'iri (DH b'Echad): In Adar they check Zera'im, which are planted in early winter. On Chol ha'Mo'ed they check Yerakos, which are planted late in the winter. Even if Kil'ayim is noticed earlier in Nisan, since the month already began, we wait until Chol ha'Mo'ed.
Rambam (11,12): Sheluchei Beis Din go out on Chol ha'Mo'ed to make Kil'ayim Hefker. We redeem captives, Erchin, Cherem and Hekdesh. We give Sotos to drink. We burn Parah Adumah, behead Eglah Arufah, pierce the ear of an Eved Ivri who wants to remain, we are Metaher Metzora'im, and mark off graves, for all of these are needs of the Rabim. We judge monetary cases, and those involving lashes or Misas Beis Din. If someone did not accept the verdict, we excommunicate him. We also write all deeds of Beis Din, such as deeds of appraisal of land and the litigants' claims. One may write a loan document if he does not trust the borrower.
Source (Magid Mishnah): The Yerushalmi (1:2) calls all of these public needs.
Rambam (12): Similarly, we may write documents of divorce, Kidushin, receipts and gifts. All of these (including the previous Halachah) are like public needs.
Ra'avad: These are Devar ha'Eved.
Migdal Oz: The Rambam agrees (with all other Meforshim) that they are Devar ha'Eved, because they are like public needs. (If they are not done during the Mo'ed, they will never get done.)
Poskim
Shulchan Aruch (OC 544:1): On Chol ha'Mo'ed we may do public needs, such as fixing roads, removing obstacles, marking off graves so Kohanim can beware, and fixing Mikva'os.
Mishnah Berurah (12): In Sa'if (2) the Shulchan Aruch permits even if it was left to be done on Chol ha'Mo'ed and it is done overtly and it is it is a great exertion. Those words apply also to here.
Magen Avraham (3): The Rosh permits public needs, even if it is a great exertion done overtly and it was planned for Chol ha'Mo'ed, because this is the only time that public needs get done. It seems that if there is a leader who can do them himself, it is forbidden on Chol ha'Mo'ed.
Mishnah Berurah (4): One may even make a Mikveh if it is needed for the Mo'ed, just like we may dig pits.
Mishnah Berurah (9): A public need is permitted through Ma'aseh Hedyot even if it will not be finished during the Mo'ed, even if it is a great exertion done overtly and it was planned for Chol ha'Mo'ed.
Kaf ha'Chayim (16): Also decrees of judges and Harsha'os are public needs.
Rema: We permit only such public needs of the body. One may not build a Beis ha'Keneses during the Mo'ed.
Source (Teshuvas Rashba 4:326, brought in Beis Yosef): Building a Beis ha'Keneses is a Ma'aseh Uman. It is not Devar ha'Eved. (Even if they have no other place to pray,) perhaps Ma'aseh Uman is permitted only for public bodily needs, such as digging pits and fixing roads, which are needed for the life and safety of the Rabim. If a thorn is in Reshus ha'Rabim, we are lenient to permit carrying it less than four Amos at a time (or even further in Karmelis) to prevent harm to the Rabim. The Yerushalmi permits to plan to fix bathhouses during the Mo'ed; not bathing leads to boils. We do not permit for an individual. He can find another place, but the Rabim cannot. The Beraisa (5a) charges mortal liability for neglecting these matters. This suggests that it discusses things vital for life. To fix the city and walls is a public need, but it is permitted only if there is mortal danger. A Tosefta (1:4) allows to destroy and rebuild a leaning wall, or to properly fix a breach in the city wall only if there is mortal danger. The Yerushalmi lists many public needs such as judging monetary cases...Erchin... Taharas Metzora... None of them are Ma'aseh Uman.
Bedek ha'Bayis: Nowadays building a Beis ha'Keneses is Devar ha'Eved, for if it is delayed, perhaps Nochrim will not allow it later.
Mishnah Berurah (6): The Rashba does not permit building a Beis ha'Keneses even if there is no place to pray, for it is not a bodily need. Some say that nowadays it is Devar ha'Eved. One must judge according to the situation.
Rema (ibid.): Likewise, Ma'aseh Uman is forbidden for other needs of Mitzvos.
Source (Gra DH v'Hu): If labor were not cheaper on Chol ha'Mo'ed, we would not send Sheluchim after Kil'ayim.
Gra (DH v'Davka): This is unlike the Shulchan Aruch below (545:2), which permits correcting a letter in a Sefer Torah when it is a public need, even though it is not a bodily need.
Mishnah Berurah (7): Sha'arei Teshuvah says that our custom is to arrange public needs on Chol ha'Mo'ed such as appointing Gabayim and leaders. One should not permit writing Ashuris for this, for this is a Ma'aseh Uman, and it is permitted only for public bodily needs.
Kaf ha'Chayim (10): If a Beis Medrash was being fixed and it was not finished before the Regel, and there will be Bitul Torah if it must be finished after the Regel, this is Devar ha'Eved. We may finish it during the Mo'ed, just like one may write down Chidushei Torah lest one forget them (even though there the concern is for a loss during the Mo'ed itself). If possible, one should hire workers who must work to afford food for the Mo'ed, and to cover up the work.
Kaf ha'Chayim (11): Avoiding arguments and the needs of visitors are public needs.