Skip to content

fix(recipe): quote values that would read back as a comment or sheet close - #427

Open
rudycelekli wants to merge 1 commit into
hypit-ai:mainfrom
rudycelekli:fix/recipe-quote-comment-and-close-values
Open

rudycelekli wants to merge 1 commit into
hypit-ai:mainfrom
rudycelekli:fix/recipe-quote-comment-and-close-values

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 19, 2026 •

Copy link
Copy Markdown

formatRecipeValue leaves a string unquoted when it has no whitespace, ;, ,, brackets, braces or quotes. Two such strings do not parse back:

"assets/*.png" -> assets/*.png -> x.svs:46: Unclosed comment.
"</sheet>"     -> </sheet>     -> x.svs:48: Only trivia may follow </sheet>.

The SVS parser reads a bare /* as the start of a comment, and a bare </sheet> as the end of the sheet. Glob-style asset patterns contain /*, and Studio writes edited SVS parameter values through this function (studio/src/parameter-values.ts). A value like these produces a sheet that no longer loads.

Strings containing /* or </sheet> are now written quoted, as JSON strings, which the parser already reads back exactly, including a quoted </sheet> (#377). Every other value is formatted as before.

The new test formats and re-parses assets/*.png, </sheet>, a bare word and a spaced string, and checks that the bare word stays unquoted. It fails on main and passes with the change. It sits in a different part of source-closure.test.ts from #396.

Checks run:

  • node --import tsx --test packages/recipe/test/*.test.ts packages/studio/test/parameter-values.test.ts packages/text/test/*.test.ts (22 passed)

…close

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant