Repository navigation
fix(schema-compiler): quote scaffolded YAML values that would not round-trip - #11495
igorlukanin wants to merge 3 commits into
Conversation
|
Claude finished @igorlukanin's task in 5m 46s —— View job Review: solid fix, one gap on the adjacent path — 1 medium-high, 1 medium, 3 lowThe diagnosis is right and the direction is right: replacing a character blocklist with a round-trip predicate is the correct shape for this, the negative cases ( Findings and review notes — 5 inline comments
Verified while reviewing
What I could not verify: |
|
Claude finished @igorlukanin's task in 3m 11s —— View job All five prior findings addressed;
|
| # | Prior finding | Status in 74407ec |
|---|---|---|
| 1 | MemberReference bypassed needsQuotes, so drill_members: [2024] stopped denoting name: "2024" |
Fixed — routed through escapedValue(value.member, flow) (YamlSchemaFormatter.ts:78), with a parametrised test that compares the parsed drill list to the parsed dimension names tagged by typeof, which is the only way the assertion can tell 2024 from "2024". That detail is the test doing real work. |
| 2 | Newline detected but not escaped; \r not detected mid-string |
Fixed, and better than suggested — JSON.stringify replaces the hand-rolled replace chain, and detection widened to [\x00-\x1f\x7f-\x9f] plus surrogates. |
| 3 | Empty alternative in YAML_TYPE_SHAPED was accidental |
Fixed — comment on line 18. |
| 4 | Comment over-claimed (sexagesimal, first-position set) | Fixed — both claims now scoped correctly, and the sexagesimal note is right: js-yaml 4's float resolver dropped the :-separated form. The YAML.load-derived alternative was declined; fine either way, and the hand-rolled version keeps the formatter free of a parse dependency. |
| 5 | yes asserted on text only |
Fixed — parse assertion added alongside. |
On JSON.stringify as the escaper
This is the right call and worth stating explicitly, since it looks like a shortcut and isn't. YAML's double-quoted style is a strict superset of JSON's: every escape JSON.stringify can emit (\" \\ \b \f \n \r \t \uXXXX) is a valid YAML escape, and ES2019 well-formed stringify escapes lone surrogates rather than emitting them raw — which is what makes the [\uD800-\uDFFF] branch actually deliver instead of just detecting.
Verified while reviewing
- No unescaped dynamic path left that I could find. Object keys are emitted raw in
render(), but every dynamic name reaches the output as a value: dimension and measure names via theentries.map(([ok]) => ({ name: ok, … }))conversion, andjoinsthe same way — so a cube named2024joined from another file renders- name: "2024"there too, consistent withrenderFile. The only raw keys are literals (cubes,dimensions,sql,type). - Cube-name quoting is self-consistent with
{}interpolation.cubeReferenceproduces{2024}.id, which the pre-existing{}rule already quotes, so the join SQL and the cube name agree on the string. - A pre-existing bug fell out of this too:
sqlForMemberon a column needing driver quoting produced{CUBE}."2024", which the old{}-only rule quoted without escaping —"{CUBE}."2024"", a parse error. Escaping fixes that path as a side effect. - Snapshots: no
__snapshots__changes in the diff, and no ordinary emitted value (public.orders,COUNT(*),Order Status) trips a new branch — consistent with the claim that all 18 are unchanged. - No security or performance surface: seven anchored regexes per scalar on a one-shot scaffolding path.
Nit (1 inline comment)
U+FFFE/U+FFFF are in js-yaml's non-printable set alongside the C1 range this PR now handles, so they're still emitted bare and fail the whole stream. One character to close; details inline. I also suggested pinning down why the C1 half works via quoting rather than escaping, since that's the kind of subtlety a later "simplification" removes.
What I could not verify
node_modules is absent in this checkout and dependency installation isn't available to me, so I did not run the suite, tsc, or eslint. The js-yaml behaviour above (the PATTERN_NON_PRINTABLE set, the JSON-character check in captureSegment, the 4.x int/float resolvers) is read from the 4.x loader source rather than observed in a run. The tests assert parsed documents, so CI is the real check here — in particular dimensionOf('2026-08-06').title depends on inflection.titleize leaving the dashes alone, which I couldn't confirm.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## igor/core-725-scaffolding-drill-members #11495 +/- ##
========================================================================
Coverage 63.88% 63.89%
========================================================================
Files 248 248
Lines 20081 20083 +2
Branches 4108 4108
========================================================================
+ Hits 12829 12832 +3
+ Misses 6662 6661 -1
Partials 590 590
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Claude finished @igorlukanin's task in 1m 18s —— View job
|
| # | Prior finding | Status |
|---|---|---|
| 1 | MemberReference bypassed needsQuotes |
Fixed in 74407ec (YamlSchemaFormatter.ts:81) |
| 2 | Newline detected, not escaped; \r undetected |
Fixed in 74407ec via JSON.stringify |
| 3 | Empty alternative accidental | Fixed (:19) |
| 4 | Comment over-claimed | Fixed (:13, :181) |
| 5 | yes asserted on text only |
Fixed (:633) |
| 6 | U+FFFE/U+FFFF uncovered | Fixed here (:209) |
Verified while reviewing
- The detection set now matches js-yaml 4's
PATTERN_NON_PRINTABLEexactly, and is a strict superset.\x85(NEL) is excluded from js-yaml's set but included by\x7f-\x9fhere — over-quoting, which is the safe direction, and harmless sinceis_EOLin js-yaml 4 is0x0A/0x0Donly, so a quoted\x85stays literal. Astral noncharacters (U+1FFFE etc.) aren't in js-yaml's set either, so their absence here isn't a gap. - No
uflag on/[\uD800-\uDFFF]/is correct, not an oversight — without it the class matches individual code units, which is what unpaired-surrogate detection needs. - U+2028/U+2029 are safe unhandled.
JSON.stringifydoesn't escape them, but js-yaml 4 follows YAML 1.2 where they aren't line breaks, so they round-trip bare. (Would be a bug under a 1.1 loader — noting it only because the file's other decisions are pinned to js-yaml 4 as well.) - No unescaped dynamic path remains. Every dynamic name reaches the output as a value: members and joins via the
entries.map(([ok]) => ({ name: ok, … }))conversion, the cube name via the explicitescapedValueinrenderFile:56. The only raw keys inrender()are literals. - The drill-member test does real work. Tagging each parsed value with
typeofbefore comparing as sets is the only formulation that distinguishes2024from"2024"— a plain sorted comparison would pass on the broken output.
Nits, all optional and none blocking
needsQuotestouches no instance state; it could sit at module level next toYAML_TYPE_SHAPED.- The
��literals are invisible in the source; a�-style spelling would read closer to the comment above them. (The current form is already the escaped spelling — noting only that the uppercase-hex convention used for\uD800two characters later differs.)
What I could not verify
node_modules is absent in this checkout and dependency installation isn't available to me, so I did not run the suite, tsc, or eslint. The js-yaml behaviour cited above is read from the 4.x loader source, not observed in a run — CI is the real check, and the tests assert parsed documents, which is the right thing for it to check.
845ad08 to
aca6b3d
Compare
e92c9bc to
a387263
Compare
|
Claude finished @igorlukanin's task in 2m 7s —— View job Rebase only — content identical to the state I already reviewed; no new findingsReview of the synchronize push (
|
f2c2e04 |
quote scaffolded YAML values that would not round-trip |
be95f27 |
quote member references and cube names, escape control characters |
a387263 |
quote the U+FFFE/U+FFFF noncharacters too |
Same three subjects, same order as f2c2e04/74407ec/e92c9bc before the rebase, and the resulting file matches the state described in my last review character for character — MemberReference routed through escapedValue(value.member, flow) (:81), JSON.stringify as the escaper (:171), the deliberate-empty-alternative comment (:19), the noncharacters in the detection class (:209), and the split explanation at :200-207. The diff is +87/-6 and +169/-0, unchanged. (I can't diff against the pre-rebase SHAs directly — they aren't in this checkout — so this is an inspection of the resulting tree, not a machine comparison.)
Re-verified against the new base
The base version of the formatter I read this time is a clean subset: renderFile still interpolates ${cube} raw, MemberReference still returns value.member, and escapedValue is still the two-regex /[{}"]/ + flow /[{}",[\]]/ form with a "-only replace. So the rebase introduced no overlap or partial duplication with the flow-sequence commit the base now carries — this PR strictly extends it, and the flow threading it relies on is the base's, untouched.
Re-audited the predicate (no execution)
Walked the ordinary emitted values through needsQuotes by hand again against the current source; none trip a new branch, consistent with the unchanged snapshots:
Order Status,COUNT(*),public.orders,users.id,default,id— no indicator in first position, no:/#, no type shape.1.2.3— the decimal alternative anchors at$, so1.2+.3doesn't match. Stays a string, correctly unquoted.12:30:00— every colon is followed by a digit, so/:(?:\s|$)/misses it and it stays bare; correct under js-yaml 4, which resolves a timestamp only with a date part.2024-13-45and08are over-quoted (invalid month, leading-zero decimal). Safe direction, no behaviour change.- Astral characters (emoji, CJK ext) match
[\uD800-\uDFFF]as a well-formed pair and get quoted — already called out in the comment at:206as costing only a pair of quotes.
What I could not verify
node_modules is absent in this checkout and dependency installation isn't available to me, so I did not run the suite, tsc, or eslint — CI is the real check. The one assertion I still can't confirm statically is dimensionOf('2026-08-06').title depending on inflection.titleize leaving the dashes alone.
Nothing blocking from my side; the same two optional nits from last time stand (needsQuotes could sit at module level; the �� literals are invisible in source next to the \uD800 spelling two characters later).
aca6b3d to
48c1740
Compare
a387263 to
39f176b
Compare
|
Claude finished @igorlukanin's task in 1m 8s —— View job Rebase only — tree matches the state I already reviewed; no new findings, all six threads resolvedReview of the synchronize push (
|
daea2cb |
quote scaffolded YAML values that would not round-trip |
affba35 |
quote member references and cube names, escape control characters |
39f176b |
quote the U+FFFE/U+FFFF noncharacters too |
Same three subjects in the same order, and the resulting diff is +87/-6 on the formatter and +169/-0 on the test file — identical totals to the pre-rebase state, with every landmark from my last review in place: MemberReference routed through escapedValue(value.member, flow) (YamlSchemaFormatter.ts:81), the cube name through escapedValue in renderFile:56, JSON.stringify as the escaper (:171), the deliberate-empty-alternative comment (:19), the noncharacters in the detection class (:209), and the escape-vs-quote split explanation at :200-207. I can't diff against the old SHAs directly, so this is an inspection of the resulting tree rather than a machine comparison.
Re-verified against the new base
The base version of the formatter is still a clean subset of this one: renderFile interpolates ${cube} raw, MemberReference returns value.member, and escapedValue is the two-regex /[{}"]/ + flow /[{}",[\]]/ form with a "-only replace. So the rebase introduced no overlap or partial duplication with the flow-sequence commit the base now carries — this PR strictly extends it, and the flow flag it threads through render() is the base's, untouched.
Prior findings — all six fixed and all six threads resolved
| # | Finding | Where it landed |
|---|---|---|
| 1 | MemberReference bypassed needsQuotes → drill_members: [2024] vs name: "2024" |
:81 |
| 2 | Newline detected but not escaped; \r undetected mid-string |
JSON.stringify, :171 |
| 3 | Empty alternative in YAML_TYPE_SHAPED was accidental |
:19 |
| 4 | Comment over-claimed (sexagesimal, first-position set) | :13, :181 |
| 5 | yes asserted on rendered text only |
test :636 |
| 6 | U+FFFE/U+FFFF uncovered | :209 |
Re-audited the predicate (by inspection, not execution)
Walked the ordinary emitted values through needsQuotes again against the current source; none trip a new branch, consistent with the unchanged snapshots — Order Status, COUNT(*), public.orders, users.id, default, id. 1.2.3 misses the decimal alternative (anchored at $), 12:30:00 misses /:(?:\s|$)/ because every colon is followed by a digit, and 2024-13-45 / 08 are over-quoted in the safe direction. escapedValue's string | number | boolean return is fine at both new call sites — both are template interpolations.
What I could not verify
node_modules is absent in this checkout and dependency installation isn't available to me, so I did not run the suite, tsc, or eslint — CI is the real check, and since the new tests assert parsed documents, it's checking the right thing. The one assertion I still can't confirm statically is dimensionOf('2026-08-06').title depending on inflection.titleize leaving the dashes alone.
Nothing blocking. The two optional nits from last time still stand: needsQuotes touches no instance state and could sit at module level next to YAML_TYPE_SHAPED, and the �� literals are now spelled as escapes (:209) — which resolves the invisible-character nit, so that one is closed too.
48c1740 to
8d79c19
Compare
39f176b to
4b187b4
Compare
|
Claude finished @igorlukanin's task in 3m 16s —— View job Looks good, no correctness bugs found. 1 low finding, 4 comment-length nits. Review details
Quoting logicI compared
I found no input that renders to a different value or to a file that fails to load. Findings
Not verifiedDependencies aren't installed in this checkout, and I don't have permission to install packages, so I couldn't run jest or a js-yaml round-trip. Everything above comes from reading the code. Review threadsThe listing returned 0 of my own unresolved threads, so none were resolved or re-affirmed. All 5 findings were posted as new inline comments. |
| ['1e5'], | ||
| // The underscores a snake_cased date leaves behind are digit separators in YAML. | ||
| ['2026-08-06'], | ||
| ])('keeps every drill member denoting a dimension for a column named %p', (columnName) => { |
There was a problem hiding this comment.
For the numeric-shaped cases (2024, 0x1f, 1e5, 2026-08-06), quoting fixes the YAML type, but the model still doesn't compile. The comment above says quoting keeps the drill from dead-ending at click time, and these four cases don't bear that out:
CubeValidator.ts:37checks member names againstidentifierRegex = /^[_a-zA-Z][_a-zA-Z0-9]*$/. So the dimension"2024", and"2026_08_06", fail validation before any drill resolves.YamlCompiler.ts:259passes eachdrill_membersentry toparsePythonAndTranspileToJs(code)as a Python expression. There,2024,0x1f,1e5and2026_08_06are numeric literals again (Python also accepts_as a digit separator), whether or not YAML quoted them.
memberName() (BaseSchemaFormatter.ts:108) keeps only [A-Za-z0-9_], so a member name can only ever hit the type-shaped rule. The cases where the MemberReference quoting changes what Cube compiles are null/true/false, which are plain identifiers in Python. The same applies to the table-name cases at :698: a cube named 2024 fails the same validator.
This isn't a regression. Either drop the numeric cases, or keep them and narrow the comment so it claims only YAML type preservation. The real fix for digit-leading names is a prefix in memberName(), which belongs in a separate change.
| // Surrounding whitespace is stripped from a plain scalar, and the loader rejects | ||
| // the whole stream — not just the one value — over a non-printable character. | ||
| // | ||
| // The two halves of the fix do different work here, so neither collapses into the | ||
| // other. Below `\x20`, `JSON.stringify` escapes, which is what a line break needs: | ||
| // quoting alone would leave a real break that YAML folds back to a space. From | ||
| // `\x7f` up it does not escape, so those survive on the *quoting* — js-yaml admits | ||
| // them inside a double-quoted scalar but not in a plain one. Hence the wide class: | ||
| // C0, C1, the U+FFFE/U+FFFF noncharacters and unpaired surrogates all reach here. | ||
| // The surrogate range also matches a well-formed astral pair, which only costs | ||
| // that value a pair of quotes. | ||
| // eslint-disable-next-line no-control-regex | ||
| /^\s|\s$|[\x00-\x1f\x7f-\x9f\ufffe\uffff]|[\uD800-\uDFFF]/.test(value) || |
There was a problem hiding this comment.
This comment is 12 lines, which is over the 3-line limit. Its middle paragraph also narrates the change ("the two halves of the fix") instead of the code. The sentence that matters is why the class goes past \x1f: from there JSON.stringify doesn't escape, so only the quoting saves the value. Suggested replacement:
| // Surrounding whitespace is stripped from a plain scalar, and the loader rejects | |
| // the whole stream — not just the one value — over a non-printable character. | |
| // | |
| // The two halves of the fix do different work here, so neither collapses into the | |
| // other. Below `\x20`, `JSON.stringify` escapes, which is what a line break needs: | |
| // quoting alone would leave a real break that YAML folds back to a space. From | |
| // `\x7f` up it does not escape, so those survive on the *quoting* — js-yaml admits | |
| // them inside a double-quoted scalar but not in a plain one. Hence the wide class: | |
| // C0, C1, the U+FFFE/U+FFFF noncharacters and unpaired surrogates all reach here. | |
| // The surrogate range also matches a well-formed astral pair, which only costs | |
| // that value a pair of quotes. | |
| // eslint-disable-next-line no-control-regex | |
| /^\s|\s$|[\x00-\x1f\x7f-\x9f\ufffe\uffff]|[\uD800-\uDFFF]/.test(value) || | |
| // Surrounding whitespace is stripped from a plain scalar. Non-printables fail the whole | |
| // stream; below `\x20` `JSON.stringify` escapes them, from `\x7f` up only quoting saves them. | |
| // eslint-disable-next-line no-control-regex | |
| /^\s|\s$|[\x00-\x1f\x7f-\x9f��]|[\uD800-\uDFFF]/.test(value) || |
The tests at scaffolding-template.test.ts:667-692 already pin each character class.
| // YAML's double-quoted style is a superset of JSON's string escaping, so | ||
| // `JSON.stringify` is exactly the escaper this needs — including the quotes. Quoting | ||
| // alone would not be enough: a raw line break inside the quotes is folded to a space | ||
| // (so the value does not come back as the string that went in) and the other C0 | ||
| // controls make js-yaml reject the file outright. Escaping is what keeps a value one | ||
| // line and one string. | ||
| return this.needsQuotes(value, flow) ? JSON.stringify(value) : value; |
There was a problem hiding this comment.
This comment is 6 lines, over the 3-line limit. The part to keep is the reason not to go back to plain quoting:
| // YAML's double-quoted style is a superset of JSON's string escaping, so | |
| // `JSON.stringify` is exactly the escaper this needs — including the quotes. Quoting | |
| // alone would not be enough: a raw line break inside the quotes is folded to a space | |
| // (so the value does not come back as the string that went in) and the other C0 | |
| // controls make js-yaml reject the file outright. Escaping is what keeps a value one | |
| // line and one string. | |
| return this.needsQuotes(value, flow) ? JSON.stringify(value) : value; | |
| // YAML's double-quoted style is a superset of JSON string escaping. Quoting without | |
| // escaping is not enough: a raw line break folds to a space and other C0 controls fail the load. | |
| return this.needsQuotes(value, flow) ? JSON.stringify(value) : value; |
| /** | ||
| * Whether a plain scalar has to be quoted to survive a YAML round-trip. | ||
| * | ||
| * Values reach here from the warehouse — `title` is the titleized column name — so | ||
| * a column named `revenue: usd` must not be allowed to turn the generated file into | ||
| * something YAML parses differently, or fails to parse at all. | ||
| * | ||
| * Each test below is a case that does not round-trip, except the first-position set, | ||
| * which over-quotes on purpose: `-abc` and `?abc` are legal plain scalars in YAML 1.2, | ||
| * but quoting is the safe direction and the rule stays one character wide. Anything | ||
| * else stays unquoted, so ordinary member names and SQL expressions are unaffected. | ||
| */ | ||
| private needsQuotes(value: string, flow: boolean): boolean { |
There was a problem hiding this comment.
This JSDoc is 10 lines, over the 3-line limit, and it repeats the per-clause comments below it. The part worth keeping is the deliberate over-quoting of the first-position set. The YAML_TYPE_SHAPED JSDoc at :8-15 is 7 lines and should be cut the same way. It needs one sentence saying that 1.1 binary/octal are included and sexagesimal is left out because js-yaml 4 doesn't resolve it. yes/on/off are already pinned by the test at scaffolding-template.test.ts:633.
| /** | |
| * Whether a plain scalar has to be quoted to survive a YAML round-trip. | |
| * | |
| * Values reach here from the warehouse — `title` is the titleized column name — so | |
| * a column named `revenue: usd` must not be allowed to turn the generated file into | |
| * something YAML parses differently, or fails to parse at all. | |
| * | |
| * Each test below is a case that does not round-trip, except the first-position set, | |
| * which over-quotes on purpose: `-abc` and `?abc` are legal plain scalars in YAML 1.2, | |
| * but quoting is the safe direction and the rule stays one character wide. Anything | |
| * else stays unquoted, so ordinary member names and SQL expressions are unaffected. | |
| */ | |
| private needsQuotes(value: string, flow: boolean): boolean { | |
| /** | |
| * Whether a plain scalar has to be quoted to survive a js-yaml round-trip. Deliberately | |
| * narrow, except the first-position set, which also quotes legal scalars like `-abc`. | |
| */ | |
| private needsQuotes(value: string, flow: boolean): boolean { |
| // The cube name is interpolated rather than rendered, so it needs the predicate | ||
| // applied by hand — it comes from the table name the same way a member name comes | ||
| // from a column, and a cube that names itself `2024` (a number) is not the cube | ||
| // another file's join refers to as `"2024"` (a string). |
There was a problem hiding this comment.
This comment is 4 lines, one over the limit. Also, the 2024 example doesn't hold up: a cube named 2024 fails Cube's identifier validation either way (see the comment on the test file). null/true are better examples. Suggested replacement:
| // The cube name is interpolated rather than rendered, so it needs the predicate | |
| // applied by hand — it comes from the table name the same way a member name comes | |
| // from a column, and a cube that names itself `2024` (a number) is not the cube | |
| // another file's join refers to as `"2024"` (a string). | |
| // Interpolated rather than rendered, so apply the quoting rule by hand: a table named | |
| // `null` or `true` would otherwise name its cube something other than a string. |
…umn starts with a digit (#12256) **Check List** - [x] Tests have been run in packages where changes have been made if available - [x] Linter has been run for changed code - [x] Tests for the changes have been added if not covered yet - [ ] Docs have been added / updated if required **Issue Reference this PR resolves** #2614 (CORE-1049) **Description of Changes Made** When you generate a data model from a table whose name starts with a digit, such as the BigQuery UUID table `public.0e4fb908-ad9a-4e3a-a21e-316ed8e72995`, the generated cube is named `0e4fb908_ad9a_…`. Compiling it then fails with "fails to match the identifier pattern". A column that starts with a digit runs into the same problem as a member name. - A new `toIdentifier` helper (`scaffolding/utils.ts`) adds a leading `_` to a name that starts with a digit. It is applied to cube names and join targets in `ScaffoldingSchema`, which now share one `cubeName()` helper so the two can't drift apart. It is also applied to member names in `BaseSchemaFormatter.memberName`. - In camelCase mode (`snakeCase: false`), cube names now replace non-alphanumeric characters before calling `inflection.camelize`, which left hyphens in place. This changes nothing for a name that was already a valid identifier. - `eligibleIdentifier` no longer accepts a leading digit. A column like `2024_amount` is now emitted as `{CUBE}."2024_amount"`. Left unquoted, SQL reads it as the number `2024` with the alias `amount`. Names that start with a letter or underscore come out the same as before, and the existing scaffolding snapshots are unchanged. **Tests** - New `test/unit/scaffolding-identifiers.test.ts` covers YAML and JS, each with `snakeCase` on and off. It scaffolds a UUID-named table that has digit-leading columns, plus a table with a foreign key to it. It then compiles both and checks that the cube and member names are valid, that the join target resolves, and that the digit-leading column is quoted. All 4 cases fail on master and pass with this change. - `scaffolding-template.test.ts` and `scaffolding-schema.test.ts` pass: 23 tests, 18 snapshots unchanged. Overlap: #11495 changes `YamlSchemaFormatter` quoting and adds a case for a table named `2024`. That table would now scaffold as `_2024`, so whichever of the two PRs merges second needs to update that case. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012rLsUqrkmWCEvgBDUFZGFH --- _Generated by [Claude Code](https://claude.ai/code/session_012rLsUqrkmWCEvgBDUFZGFH)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
Summary
escapedValuedecided quoting from/[{}"]/(plus,[]inside a flow sequence), which leaves several characters that change how YAML parses a scalar emitted bare. This is reachable from ordinary warehouse data, not just from a cast: a dimension'stitleisinflection.titleize(column.name), so a column namedrevenue: usdrenderstitle: Revenue: Usdand the generated model file fails to parse at all, whileprice # netsilently truncates the title toPrice.needsQuotespredicate covering the cases that demonstrably do not round-trip: a leading indicator character,:or a trailing colon,#, surrounding whitespace, a tab or newline, and a scalar YAML would resolve to null / a boolean / a number / aDaterather than a string. The existing{}"rule and the flow-sequence,[]rule are kept.C:\pathused to be emitted as"C:\path", which is an invalid escape and a parse error;tab\therebecame a real tab.a#b,a:b,COUNT(*),users.id,Order Statusandyesstay unquoted, so ordinary member names, titles and SQL expressions are untouched. All 18 existing snapshots are unchanged.Stacked on the
drill_membersbranch, which introduced the flow-context flag this extends; it targets that branch rather thanmaster.Test plan
scaffolding-template.test.ts, asserting the parsed document rather than the rendered text — the defect is that the output parses as something other than the string that went in, which a text assertion cannot seetsc --noEmitandeslintclean on both changed files