undoDepthForTest

Test-only: depth of the undo stack. The test now lives in this module's own test source set, which can see internal; the property stays public because narrowing it would break published API.