In my world there is a neolithic civilization of people who inhabit earthen trenches. The people first soften the earth with ... fluids ... and dig out 6 - 12 foot deep trench systems that extend out for many square miles with bamboo and ceramic trowels & spades.
Though digging out massive trench systems with what is essentially a grass stick is extremely labour intensive, they can provide all that they need in and around the trenches; planted oak trees to make acorn bread, planted potatoes, yams, snails and mushrooms for extra food sources, bamboo, hemp and stone for building material, rope, cloth, you get the point.
Also, since the trenches are easily defendable , they need not worry about invasions. However, there is one issue which they cannot overcome:
When it rains any significant amount the entire trench system is partially flooded. Crops get drowned and buried, food is spoiled, paper and clay tablets get ruined and lost in the sludge, fungus grows on stored seeds and earth is turned into mud, which makes the trench practically unlivable until the trenches completely dry, which may take days.
That, however, isn't even the worse part. Any sort of flooding necessitates a complete evacuation. Everything a trench dweller may own is completely lost under the murky water, sometimes including their life (since they can't swim) and it basically turns their homes into a permanent canal, forcing them to start all over. On Top of all of that the problem follows them wherever they go, since they have to live near some sort of water source.
My Question is: how might such a civilization keep water out of their trenches?