isPositionalSemanticId function
Whether id is an auto-generated positional id — one that can come to
denote a different logical node when the tree shifts, so a held reference to
it may go stale. Two forms qualify: the element-<hash> snapshot-local
fallback, and a derived auto:… id carrying a ~ positional segment (see
semanticAnchorOf). Those shapes are reserved at Semantics.id intake.
Other app-assigned ids, key:…, and fully-keyed auto: ids (no ~) track
their logical node and are stable.
Lives beside the encoding so the id scheme has a single owner: consumers that
guard against stale references (e.g. fleury_mcp) ask here rather than
re-deriving the prefix rules.
Implementation
bool isPositionalSemanticId(String id) =>
id.startsWith('element-') || (id.startsWith('auto:') && id.contains('~'));