intent: a posts: set: constant renders as a Java string literal (#7246) - #7268
Merged
Conversation
`GlueIntentGenerator.postSetExpr` recognised a string value only while it still carried its double quotes, which YAML strips long before the renderer sees it. An authored `Note: issued` therefore missed every branch and fell through the pass-through, emitting `row.Note = issued;` - a bare identifier that stops the whole generated module compiling. The construct's own javadoc documented "a quoted string" as a supported form and `GluePostsTest` covered the item / negation / integer / source forms only, so nothing caught it. The value vocabulary now lives in one place, `PostSetSupport`, shared by the renderer and a new parse-time refusal so the two cannot drift: - a plain constant renders as an ESCAPED Java string literal (the #7154 / #7241 family - a value carrying a quote or a backslash cannot end the literal it is written into); - a number, `true` / `false` / `null`, and a value the author quoted explicitly keep their non-text reading; - a value that reads as an EXPRESSION the renderer cannot compile - a dotted path off anything but `item` / `source`, or a negation of anything but a per-item copy - is refused at parse time, naming the rule and the field. The refusal is the point of the third case: rendering `Receipt.Store` as the string "Receipt.Store" would put the text of the path into the ledger cell instead of the value it names, which is silent in exactly the way passing it through was. An author who really means that text quotes it. The `PostIntent` example is corrected with it: it showed `Store: Receipt.Store` and `GoodsReceipt: Receipt.Id`, neither of which the renderer ever supported (the back-reference is written by the generated handler, not authored). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 10, 2026
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.
Fixes #7246
The defect
GlueIntentGenerator.postSetExprtested aset:value against"[^"]*"for its string branch - it only fired while the value still carried its double quotes, which YAML strips long before the renderer sees it. An authoredreached the renderer as
issued, missed every branch and fell through the final pass-through, so the template emittedand the whole generated module stopped compiling.
PostIntent's own javadoc documented "a quoted string" as a supported form, andGluePostsTestasserted the item / negation / integer / source forms only, so nothing caught it.The change
The value vocabulary moves into one place,
PostSetSupport, shared by the renderer and a new parse-time refusal so the two cannot drift:true/false/null, and a value the author quoted explicitly keep their non-text reading (the quoting is also the escape hatch for a constant that reads like an expression);item/source, or a negation of anything but a per-item copy - is refused at parse time, naming the rule and the field.The refusal is the point of the third case. Rendering
Receipt.Storeas the string"Receipt.Store"would put the text of the path into the ledger cell instead of the value it names - silent in exactly the way passing it through was, and worse than a compile error. Refusing before anything is written is the honest outcome, and an author who really means that text quotes it.The
PostIntentexample is corrected with it: it showedStore: Receipt.StoreandGoodsReceipt: Receipt.Id, neither of which the renderer ever supported (the back-reference named byidempotentByis written by the generated handler, not authored).Tests
GluePostsTestgains the constant to the existing descriptor assertion (Note: issued->"issued"), plus the escaping of a quote / backslash, the non-text forms, and the parse-time refusal naming the rule and the field. Fullengine-intentsuite green (1190 tests);formatter:validateand the release-profile javadoc clean on the module.🤖 Generated with Claude Code