Repository navigation
Resolve Yaml core schema tags - #10285
Closed
effect-bot wants to merge 6 commits into
Closed
effect-bot wants to merge 6 commits into
effect-bot wants to merge 6 commits into
Conversation
🦋 Changeset detectedLatest commit: 3dfbaab The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
tim-smart
force-pushed
the
v4/next-minor
branch
from
November 3, 2026 20:54
2e13c53 to
5f5a4b3
Compare
effect-bot
force-pushed
the
v4/next-minor
branch
7 times, most recently
from
November 3, 2026 22:52
97a1ee1 to
10d44ad
Compare
effect-bot
force-pushed
the
agent/nelson-effect-bot/eff-3232-stage5-core-tags
branch
from
November 3, 2026 23:14
cc45e2e to
56f1a86
Compare
effect-bot
force-pushed
the
v4/next-minor
branch
from
November 3, 2026 23:39
2650b53 to
0a68f11
Compare
effect-bot
force-pushed
the
agent/nelson-effect-bot/eff-3232-stage5-core-tags
branch
from
November 3, 2026 23:39
56f1a86 to
7f10be2
Compare
effect-bot
changed the base branch from
v4/next-minor
to
agent/effect-bot/eff-3232-flow-plain-dash
November 3, 2026 23:40
effect-bot
changed the base branch from
agent/effect-bot/eff-3232-flow-plain-dash
to
v4/next-minor
November 3, 2026 23:40
This was referenced Nov 3, 2026
Closed
effect-bot
changed the base branch from
v4/next-minor
to
agent/effect-bot/eff-3232-flow-plain-dash
November 3, 2026 23:42
The shorthand tags !!str, !!int, !!float, !!bool, !!null, !!seq and !!map resolve against the scalar as written, a mismatched node fails, and every other tag, including verbatim and non-specific tags, still fails.
Tags keep the token start for structure and comment scanning, a node's properties may continue on the next line and its anchor records the resolved value, and a node has at most one anchor and tag, no properties on an alias, and separation before flow content.
A scalar tag on a flow collection key fails like a tagged collection value, and a node starting with '&' must name its anchor.
effect-bot
force-pushed
the
agent/effect-bot/eff-3232-flow-plain-dash
branch
from
November 3, 2026 23:43
738de7d to
49c0762
Compare
effect-bot
force-pushed
the
agent/nelson-effect-bot/eff-3232-stage5-core-tags
branch
from
November 3, 2026 23:43
7f10be2 to
3dfbaab
Compare
Contributor
Author
|
Superseded by #10287, which now holds the rest of the YAML expansion as one PR against |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is stage 5 of the YAML expansion:
Yaml.parseandYaml.parseAllnow resolve the core schema's tags instead of rejecting every tag.Behavior (YAML 1.2.2 §10.3)
The shorthand core tags resolve:
!!str,!!int,!!float,!!bool,!!null,!!seqand!!map. A scalar tag applies to the scalar as written, so!!str 0x10is"0x10",!!str ~is"~", and!!int "42"is42. For quoted and block scalars, that means the decoded string. An empty tagged node is the empty string:a: !!strgives""anda: !!nullgivesnull.The spec's patterns decide what each tag accepts:
!!int: decimal,0oand0xintegers!!float: decimals with an optional fraction and exponent, so1and-1.are floats, plus.infand.nanin their three spellings!!bool:trueandfalseas lowercase, capitalised or uppercase!!null:null,Null,NULL,~and emptyyaml2.9.1 rejects!!float 1; the spec's float pattern matches it, so this follows the spec.A node that doesn't match its tag fails:
!!int x,!!bool yes,!!float 0x10,!!str [1],!!seq {a: 1}, an empty!!map, and so on.Where tags can appear: block and flow values, block and flow keys, the document root, block scalars, and quoted scalars. A tag can come before or after an anchor, and the anchor records the resolved value. A tagged key never merges. A second tag on one node fails, and so does a tag on an alias.
Still rejected, with the tag named in the error:
!custom)!!<tag:yaml.org,2002:str>, even when they name a core tag!!binary,!!timestamp,!!set)!!tagsThe agreed scope covers the shorthand forms only. Both the module docs and the release note say so.
Plain scalars that contain
!(x!y,hello!) are still plain text.Docs
parseJSDoc explains that a tag applies to the scalar as written. Its doctest now resolves!!str 8080and rejects!custom 8080..changeset/yaml-core-tags.md(minor).Validation
Yaml.test.ts: 286 of 286, including the 13 stage 5 "resolves" rows. No test was changed.yaml2.9.1, apart from the intended verbatim rejection. They cover tag-then-anchor order, tags on the next line, indentless!!seq, a tagged<<key, flow anchors on tagged keys,!!float .nan, tab separation, multiple tags, a tag on an alias, and folded block scalars.pnpm lint,pnpm jsdocs --checkand theYaml.tsdoctests pass.pnpm checkreports one error, theapiStabilityLeakincluster/ShardingRegistrationEvent.ts, which also occurs onv4/next-minor.Stack
These PRs form one stack. Each targets the PR before it, so its diff shows only its own stage. Merge them in this order:
Yaml.parseAllandResultfromYaml.parse(merged)v4/next-minorYaml.stringifyandYaml.stringifyAll, based on Resolve Yaml core schema tags #10285Yaml.parse, based on Add Yaml.stringify and Yaml.stringifyAll #10272After a PR in the stack is squash-merged, the next one has to be rebased onto the squash commit and retargeted to
v4/next-minorbefore it can merge.Closes EFF-3232