format

fun format(path: String, repetitions: List<Int>): String

Render path (with or without a leading /) and its positional repetitions as the canonical string.

This is the string CODEC, so it carries the codec's precondition — every written name must match the part grammar, so that what it emits parse reads back as the same pointer. That is narrower than A12Pointer's value domain on purpose, and the narrowing belongs to the string, not to the pointer: a part whose name carries a / or a bracket is a legal A12PathPart and simply cannot be written.

It used to check only the arity, which let it emit 4,321 strings its own parser refused.