Every preserve + announce pair in the compiler emits a diagnostic stating that a construct was
"kept verbatim under Unmodeled", then writes the entry. When the raw conversion fails, the write
silently records nothing and the diagnostic still claims the construct survived.
nodeToRaw fails on a YAML mapping whose keys are not strings — legal YAML, and reachable in a
vendor extension or inside a preserved validation-only keyword:
x-weird:
? [a, b]
: value
The result is a diagnostic asserting preservation with no entry behind it, which is worse than
either outcome alone: a consumer that trusts the diagnostic looks for a key that is not there,
and a consumer auditing losslessness sees a clean report.
Scope
This is file-wide rather than one site — preserveUnionSiblings, the path-servers site, the
error-headers site, the requestBody-optionality site and the allOf-branch residue site all share
the shape. The honest fix is a shared guard across every preserve-and-announce pair: either the
entry is written and the diagnostic fires, or neither happens and a different diagnostic reports
that the construct could not be represented at all.
Worth deciding at the same time whether an unrepresentable construct is an error rather than
an info — it is a genuine losslessness failure, not a degradation.
Method
Found while adding the allOf-branch residue path, by reading the existing preserve idiom rather
than by probe; the failure mode follows from nodeToRaw returning an error that the callers do
not branch on.
Every
preserve+ announce pair in the compiler emits a diagnostic stating that a construct was"kept verbatim under Unmodeled", then writes the entry. When the raw conversion fails, the write
silently records nothing and the diagnostic still claims the construct survived.
nodeToRawfails on a YAML mapping whose keys are not strings — legal YAML, and reachable in avendor extension or inside a preserved validation-only keyword:
The result is a diagnostic asserting preservation with no entry behind it, which is worse than
either outcome alone: a consumer that trusts the diagnostic looks for a key that is not there,
and a consumer auditing losslessness sees a clean report.
Scope
This is file-wide rather than one site —
preserveUnionSiblings, the path-servers site, theerror-headers site, the requestBody-optionality site and the allOf-branch residue site all share
the shape. The honest fix is a shared guard across every preserve-and-announce pair: either the
entry is written and the diagnostic fires, or neither happens and a different diagnostic reports
that the construct could not be represented at all.
Worth deciding at the same time whether an unrepresentable construct is an
errorrather thanan
info— it is a genuine losslessness failure, not a degradation.Method
Found while adding the allOf-branch residue path, by reading the existing preserve idiom rather
than by probe; the failure mode follows from
nodeToRawreturning an error that the callers donot branch on.