I think the problem of finding edges can be solved by stepping back and redefining primitives. One idea I had was defining them as a 2D sketch and a transformation function along a path. A sphere would be a 2D hemisphere that rotates as it moves along a circular trajectory, with the flat side staying in place, for example. A cube would be a square That moves along a vertical or horizontal path the distance of the sides. You get the idea.
The advantage of this type of representation is that edges can only ever be edges in the 2D shape, or the path traveled by vertices. The hard part is that when you do boolean operations using primitives, you probably want to go back and turn it into a primitive representation (2D shape, transformation along a path).
I wonder if there are any ideas on how to make this a OpenSCAD-style editor instead of interactive? I like the text-based style for simple regular shapes, but they tend to end up too simple and regular. Maybe tools like filleting edges SDF-style is a game changer?
But if you are into code-style SDF interfaces, I have some links on https://incoherency.co.uk/notes/sdf.html