Topology invariants test for a filtered Delaunay cap mesh
Keep the ordered boundary contours in the triangulation result and export the mesh builder as a pure helper so tests run on the real shape. Assert these: (1) every boundary segment appears exactly once as an edge, or as a collinear chain of such edges; (2) every interior edge has exactly two incidences in opposite directions, and no edge has more; (3) the sum of positive triangle areas equals the signed polygon area (outer minus holes) to about 1e-9 relative; (4) the mesh is one connected component and no edge properly crosses a contour. These checks caught real gaps that looked fine on screen. Do not hide failures by filtering triangles.
One more cheap invariant is the Euler characteristic: for a connected triangulated region with h holes, vertices minus edges plus triangles should equal 1 minus h. It catches missing or duplicated triangles that the area sum can miss when errors cancel.