intent: the glue stops carrying Criteria, java.time and BigDecimal - the query, the period and the compared default become data (#7406) - #7426
Merged
Conversation
…the query, the period and the compared default become data (#7406) Stacked on #7405, which took the `.edm`/`.model`'s `checks[]`. The `.glue` is the same kind of artefact for the process half - the description every template reads, Java and JavaScript alike - and `GlueIntentGenerator` was writing Java SOURCE into it: "criteriaExpression": "Criteria.create().lt(\"Due\", java.time.LocalDate.now())" "lower": "java.time.LocalDate.now().withDayOfMonth(1)" "upper": "java.time.LocalDate.now().withDayOfMonth(1).plusMonths(1).minusDays(1)" "derivedDefault": "new java.math.BigDecimal(\"1\")" Across the BusinessIntents fleet that is 69 of the ~135 java-carrying values, and the whole `org.eclipse.dirigible.sdk` builder surface. The glue now carries the same facts as data, and the language appears one layer out, in `JavaLiterals`: "criteria": [ { "op": "lt", "property": "Due", "value": { "kind": "moment", "shape": "date", "offset": "P7D", "forward": false } } ] "kind": "range", "property": "Date", "period": "month" "derivedDefaultValue": { "kind": "number", "text": "1" } - `ScheduleSupport` keeps the operator vocabulary, the moment grammar and every refusal, and returns the CLAUSES instead of the chain (`criteria` / `conditions`, replacing `criteriaExpression` / `conditionChain`); `Moment.javaExpression` is gone, its rendering having moved. A create-from's source-row rule (`items: where:`) rides the same reading as `itemCriteria`. - A roll-up's and an expansion's criteria were never more than `eq(<fk>, <owner>.<key>)` over values the descriptor already carries, so they are dropped from the glue outright and built by the binder. - A `run:` key term carries the PERIOD the author declared rather than where that period begins and ends - which is also the only place the two bounds stay derived from each other. - `JavaLiterals` gains `criteriaChain` / `criteriaExpression`, `periodLowerExpression` / `periodUpperExpression` / `todayExpression` and `derivedDefaultExpression`; `GlueGenerator` calls them in the four binders that used to copy the rendered key. - Every one of those binders falls back to the rendered key when the descriptor carries it, so a project generated before this renders byte-identically until it is regenerated - the rule `hasGenUnique` and the #7234 spellings already follow. The `ModelGenerationIT` fixture `orders.glue` still carries `criteriaExpression` and exercises that path. What is NOT in this change: the `expr` / `guard` / `guardExpr` / `dueExpression` / `guardExpression` / `languageExpression` / `fileNameExpression` family - the ternaries, the `Calc.eval` guards and the print SDK calls. Those are expressions, not literals or builder chains, and #7406 asks for them last and deliberately; the issue stays open for them. Verified: `engine-intent` (1326) and `ide-template` (176) unit suites green; `IntentEmissionCoverageIT`, `IntentEngineIT` and `ModelGenerationIT` green - the first compiles and runs the generated handlers, the last regenerates from a pre-split `.glue`. `IntentEngineIT` now asserts the neutral clauses AND that no `Criteria.create()` appears anywhere in the generated glue. Fixes #7406 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 #7405, which took the
.edm/.model'schecks[]. The.glueis the same kind of artefact for the process half — the description every template reads, Java and JavaScript alike — andGlueIntentGeneratorwas writing Java source into it:Across the BusinessIntents fleet that is 69 of the ~135 java-carrying values, and the whole
org.eclipse.dirigible.sdkbuilder surface. The glue now carries the same facts as data, and the language appears one layer out, inJavaLiterals:The change
ScheduleSupportkeeps the operator vocabulary, the moment grammar and every refusal, and returns the CLAUSES instead of the chain (criteria/conditions, replacingcriteriaExpression/conditionChain);Moment.javaExpressionis gone, its rendering having moved. A create-from's source-row rule (items: where:, intent: generates items: has no source-row rule - every member row is cloned into a line, so an empty or unapproved EmployeeTimesheet is billed (or blocks the whole month) #7091) rides the same reading asitemCriteria.eq(<fk>, <owner>.<key>)over values the descriptor already carries, so they are dropped from the glue outright and built by the binder.run:key term carries the PERIOD the author declared rather than where that period begins and ends — which is also the only place the two bounds stay derived from each other.JavaLiteralsgainscriteriaChain/criteriaExpression,periodLowerExpression/periodUpperExpression/todayExpressionandderivedDefaultExpression;GlueGeneratorcalls them in the four binders that used to copy the rendered key.hasGenUniqueand the postings: an aggregate: true header column a posting maps is overwritten by save()'s recalculate and read as an amendment on every redelivery; the expressionDefault rename has no .glue fallback #7234 spellings already follow. TheModelGenerationITfixtureorders.gluestill carriescriteriaExpressionand exercises that path.What is deliberately not here
The
expr/guard/guardExpr/dueExpression/guardExpression/languageExpression/fileNameExpressionfamily — the ternaries, theCalc.evalguards and the print SDK calls. Those are expressions, not literals or builder chains; #7406 asks for them last and deliberately, and they are now tracked, inventoried, in #7425.Verified
engine-intentunit suite green (1326 tests),ide-templategreen (176).IntentEmissionCoverageITgreen — it compiles and runs the generated handlers, so the generated Java is byte-identical where it matters.IntentEngineITgreen; its glue assertion now pins the neutral clauses and that noCriteria.create()appears anywhere in the generated glue.ModelGenerationITgreen — it regenerates from a pre-splitorders.glue, so the backward-compatible path is covered by a run, not only by a unit test.mvn formatter:validateclean with the formatter cache wiped.Not verified: no end-to-end run against a deployed instance, and no fleet regen — the fleet's
.gluefiles will change shape on their next regen (the three keys above), which is the intent.Fixes #7406
🤖 Generated with Claude Code