fix: accept folded block scalars in handoff YAML - #214
Merged
Conversation
closeout_summary: >- is valid YAML and the natural choice for a wrapped prose field, but the parser handled only | and |-. A >- header fell through to the plain-scalar path and the block body underneath then failed the indentation check, so the error blamed whitespace when the cause was the scalar style — sending you re-indenting instead of changing one character. It matters because a handoff is usually written by a model, and a model writing wrapped prose reaches for >-. Found during the 0.19.2 surface verification by writing a handoff by hand and hitting it on the first try. Both block styles and all three chomping indicators are now supported — |, |-, |+, >, >-, >+ — with real folding semantics: a single break between content lines becomes a space, a run of k blank lines becomes k newlines, and more-indented lines keep their breaks so a folded block can still carry an indented snippet. Literal blocks parse exactly as before, and |+ is newly supported alongside them. Closes #211 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
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.
Closes #211.
closeout_summary: >-is valid YAML and the natural choice for a wrapped prose field, but it failed with:The parser handled only
|and|-. A>-header fell through to the plain-scalar path, and the block body underneath it then failed the indentation check — so the error blamed whitespace when the cause was the scalar style. That sends you re-indenting instead of changing one character; it did exactly that to me.It matters because a handoff is usually written by a model, and a model writing a wrapped prose field reaches for
>-. Found during the 0.19.2 surface verification by writing a handoff by hand and hitting it on the first try.The fix
Both block styles and all three chomping indicators —
|,|-,|+,>,>-,>+— with real folding semantics:Literal blocks parse exactly as before;
|+is newly supported alongside them. A value that merely starts with an indicator (|x,> not a header) is still a plain scalar.templates/phase-handoff.yamlsaid "YAML literal blocks are supported" — accurate before, incomplete now. It names both styles.Verification
The exact handoff that failed during the 0.19.2 verification now parses:
Six new tests in
tests/yaml.test.mjscover folding, all three chomping indicators, blank-line runs, more-indented lines, literal-block regression, and the not-a-header cases.npm run buildclean, 677/677 tests pass.🤖 Generated with Claude Code