You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(metadata,ts): loader populates yamlPosition on yaml-loaded nodes [FR5b]
buildTree's parser-core threads a `sourceFormat: "json" | "yaml"` option
and module-level `_currentYamlPosition` through the recursive walk; each
parseNodeFresh call site (root + per-child in processChildren) reads the
wrapper's position-by-key map and sets `_currentYamlPosition` before the
node factory runs, then restores the parent's position on the way out.
populateNodeSource() stamps the optional yamlPosition on the node's
source envelope; errSource() (used by mid-parse throws) does the same.
Per the FR5b spec's "format becomes yaml" branch, the type union of
ErrorSource was widened so the `format: "json"` variant also accepts an
optional `yamlPosition`. The cross-port reason for keeping
`format: "json"` (rather than flipping to `"yaml"` per the spec) on
buildTree-emitted errors is documented in source.ts: until C#/Java/Python
also ship FR5b, flipping the discriminator would diverge TS from the
three other ports' parser output and the existing yaml-conformance
fixtures' format-discriminator. The next FR5b TS PR — once all four
ports support yamlPosition — flips format to `"yaml"` and mass-updates
the fixtures in lockstep.
Adds test/yaml-positions.test.ts (11 tests, 33 assertions): walker layer
(position-by-key map presence + non-enumerable + alias resolution),
desugar layer (Rule-5 rename, Rule-2 scalar inheritance, Rule-4 `[]`
strip), loader layer (root + nested nodes carry yamlPosition; JSON
control has no yamlPosition; mid-parse ERR_RESERVED_ATTR error envelope
carries the YAML position; empty body still gets the wrapper's
position).
Test counts: 1226 -> 1237 in packages/metadata (no regressions; +11
new). Full server/typescript suite: 2680 pass, 0 fail.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments