Tagged path rejects alias mapping keys and drops key anchors #12
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Status (2026-07-12)
Open. Disclosed as a known limit while closing #9: the anchors/aliases/styles
round-trip work preserves alias structure in VALUE positions, but a document
using an alias where a mapping key is expected (
*b : value, yaml-test-suiteE76Z/26DV) still fails to parse on the
Taggedpath withexpectedScalarKey.This is pre-existing behavior, not a regression:
Tagged.EventComposer'scomposeMappingKeyaccepts only scalar events. The plainparse(_:)pathhandles alias keys correctly (see
AliasAsMappingKeyTests), so this is aTagged-path capability gap only.Related: an anchored scalar KEY's anchor is registered for later alias
resolution but is not carried on the pair itself, so it does not re-emit
(
Tagged.Pair.keyis aString, not a node). Same root cause, same fixsurface.
Impact
parseTagged(_:)rejects documents the primary parser accepts whenever analias stands in key position, and a round trip through
Tagged.Dumperlosesanchors that sit on keys. The corpus round-trip law in
TaggedNodeCorpusRoundTripTestscounts these documents as "rejected", so thegap is visible, not silent.
Work
Tagged.Pair's key fromStringto a node-carrying representation(a
Tagged.Nodeor a scalar-plus-properties key type). This is a breakingchange to
Tagged.Pair,Tagged.Mapping's subscript,Tagged.Constructorkey handling, and the validator's key-uniqueness check, so it should land
as its own pass, not ride along on another change.
composeMappingKeyto accept alias events (resolving through theanchors table like
composeNodedoes) and to carry key anchors.Tagged.Dumper.renderBlockPair/renderInlineto emit keyproperties and alias keys (
*a : value)."rejected" to round-tripping with alias-key topology intact.
Part of #8.