A12PointerFormat

A12's canonical exact DocumentPointer string — the project's single addressing form for a resolved cell (CLAUDE.md "NEVER invent a shape A12 already defines"). Grammar, per kernel 30.8.1 DocumentPointerImpl/PathPartImpl: parts joined by /, each part a name optionally followed by [n]. An absent bracket means repetition 1 and the canonical form omits [1], so Recipe/Ingredients[3]/Name is canonical and a field part carries no bracket. A leading / is accepted and stripped as redundant; a trailing / is rejected.

This is the EXACT pointer only, and the distinction is load-bearing. Two sibling A12 types share the bracket syntax and mean different things by it:

  • DocumentMultiPointer, where 0 is WILDCARD ("all repetitions") and legal at every part — the kernel's own example is a[0]/b[2], wildcard on the first.

  • PartiallyKnownDocumentMultiPointer, the type IMessage returns, which admits that same wildcard and UNKNOWN (-5) at any part. That one is modelled by A12PartiallyKnownMultiPointer.

On an exact pointer 0 is neither: on the last part it addresses the RepetitionsV2 node, and earlier it is simply rejected. This file once called 0 "the wildcard" while enforcing the exact rule, and later admitted -5 as well — borrowing one type's vocabulary, then its domain, for another type's constraint. The union of the two domains is a shape A12 has nowhere, so it belonged to neither channel; both are now separate types whose accept/reject sets are measured against the kernel factories in A12PointerKernelDomainDiffTest.

Properties

Link copied to clipboard
const val LAST_PART_ZERO: Int = 0

The repetition A12 permits only on an exact pointer's LAST part, where it addresses RepetitionsV2.

Functions

Link copied to clipboard
fun format(path: String, repetitions: List<Int>): String

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

Link copied to clipboard
fun parse(pointer: String): A12Pointer

Parse a canonical (or leading-slash) exact pointer string.

Link copied to clipboard
fun render(pointer: A12Pointer): String

The canonical string of an already-built pointer — no re-parse of its A12Pointer.fullName.