Repository navigation
fix(lang)!: read a quoted !ii scalar as its text - #528
Merged
Merged
Conversation
vjaganat90
force-pushed
the
fix/quoted-ii-is-text
branch
from
October 9, 2026 19:45
4bb40e3 to
f028156
Compare
vjaganat90
force-pushed
the
fix/quoted-ii-is-text
branch
from
October 9, 2026 20:13
f028156 to
65c5d38
Compare
vjaganat90
force-pushed
the
fix/quoted-ii-is-text
branch
4 times, most recently
from
October 13, 2026 15:50
4cc07ce to
ced5545
Compare
vjaganat90
force-pushed
the
fix/quoted-ii-is-text
branch
3 times, most recently
from
October 13, 2026 17:41
6baf579 to
7f796e5
Compare
A tag switches off YAML's implicit typing, so the parser re-read an `!ii`
scalar's text to recover numbers and booleans, without looking at how it
was written: `!ii '5'` became the int 5, and there was no way to write
text that YAML would type. I now read an `!ii` scalar as YAML reads the
same scalar untagged: plain by what it says, quoted or block as its text.
The desugared `{wic_inline_input: '5'}` already read that way.
The writer keeps the distinction: a string YAML would read as something
else is written quoted, `!ii '0'`, instead of falling back to the
desugared spelling, whose reason is gone. The fallback for a construct as
the direct payload stays, since two tags cannot share a node. A plain
spelling is transcribed plain, so `!ii 1:30` no longer comes back quoted
and re-typed.
Every quoted `!ii` in mm-workflows and image-workflows is a glob or a
path, or a `max_times` the real-time declaration accepts as a digit
string, so the corpora compile unchanged.
write_wic wrote every step as `run: <stem>.cwl` with the tool copied beside the document. A `run:` path that exists is registered under a name of its own, so a cwl_subinterpreter step read back from the bundle no longer ran the registry's adapter: it was an ordinary tool step, emitted into the CWL, with its literals type-checked against the adapter's inputs. The objects compiled to a declaration and their bundle to a step, and `max_times: !ii '20'`, which the declaration reads as 20, became a wic020 on the step's int input. I now write the adapter by its registry stem, `run: cwl_subinterpreter`, and leave it out of the bundle, so the bundle declares the same analysis the objects do and the declaration stays the one place that reads `max_times`.
vjaganat90
force-pushed
the
fix/quoted-ii-is-text
branch
from
October 13, 2026 18:05
7f796e5 to
d69e945
Compare
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.
Stacked on #527 (
ci/release-artifact-check). Merge that first; this PR's own changes are the commits above it.What
!iiscalar is its text, and a plain one is read as YAML reads the same plain scalar.!ii '5'is the string"5", and!ii 5stays the int. A block scalar (!ii |) is text too, as YAML reads it.!ii '0',!ii '1:30',!ii '') instead of falling back to the{wic_inline_input: ...}spelling.!cwl,!*and!&payloads are written plain wherever that is safe, and read back the same.write_wicwrites a real-time declaration back asrun: cwl_subinterpreterand leaves the adapter out of the bundle. It used to copy the adapter beside the document asrun: cwl_subinterpreter.cwl, which read back as an ordinary tool step, somax_times: !ii '20'became a wic020 on the step's int input once quoting meant text.!ii '007'is rewritten, and the language guide and spec state the rule.Why
!iire-read the text of a tagged scalar to recover numbers and booleans, but it never looked at the quoting, so quoting could not mean text.!ii '5'on astringinput arrived as the int 5. Now a quoted number on anintinput is wic020, not a silent conversion.Checked against the external corpus (fresh mm-workflows and image-workflows): the compiled output is identical before and after. Its only quoted numbers are
max_times: !ii '20'on real-time declarations, which accept a string integer.