Skip to content

intent: the glue stops carrying Criteria, java.time and BigDecimal - the query, the period and the compared default become data (#7406) - #7426

Merged
delchev merged 1 commit into
masterfrom
issue-7406-glue-neutral-expressions
Sep 17, 2026
Merged

delchev merged 1 commit into
masterfrom
issue-7406-glue-neutral-expressions

Conversation

@delchev

@delchev delchev commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

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" }

The change

What is deliberately not here

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; #7406 asks for them last and deliberately, and they are now tracked, inventoried, in #7425.

Verified

  • engine-intent unit suite green (1326 tests), ide-template green (176).
  • IntentEmissionCoverageIT green — it compiles and runs the generated handlers, so the generated Java is byte-identical where it matters.
  • IntentEngineIT green; its glue assertion now pins the neutral clauses and that no Criteria.create() appears anywhere in the generated glue.
  • ModelGenerationIT green — it regenerates from a pre-split orders.glue, so the backward-compatible path is covered by a run, not only by a unit test.
  • mvn formatter:validate clean with the formatter cache wiped.

Not verified: no end-to-end run against a deployed instance, and no fleet regen — the fleet's .glue files will change shape on their next regen (the three keys above), which is the intent.

Fixes #7406

🤖 Generated with Claude Code

…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>
@delchev
delchev merged commit f6fe065 into master Sep 17, 2026
10 checks passed
@delchev
delchev deleted the issue-7406-glue-neutral-expressions branch September 17, 2026 12:51
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.

engine-intent: the .glue carries Java source too - expression keys need the same neutral-model split as checks[] (#7405 follow-up)

1 participant