Skip to content

Sync ako/mxcli: two breaking fixes (error-handler retry loop, Association: spelling); association and input round trips; OData drop and CDC versioning; MDL126-129 - #2008

Merged
ako merged 30 commits into
mendixlabs:mainfrom
ako:main
Dec 1, 2026

Conversation

@ako

@ako ako commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Syncs ako/mxcli:main into upstream: 14 commits since the last sync (#2005) — two breaking fixes (a one-sided if at the end of an error handler no longer becomes a retry loop; a pluggable widget's association is written Association: only), round-trip fixes for association delete behaviour and input accessibility properties, OData client and change data capture fixes, and checks that close every gap the fourth check-gap parity sweep found.

Fixes #1995, fixes #1996, fixes #1997, fixes #2007.

Breaking

Round trips

OData

  • drop odata client lists and fully drops its external entities. It removed them without saying so, leaving dangling references, and missed entities imported into another module, which then failed with CE1613. It now finds them in every module, warns about each one's referrers, and reconciles access rules.
  • alter consumed odata service … set (MetadataUrl: …) says it does not refresh, and names the two statements that do; the refresh flow is now in mxcli syntax and the docs.
  • A bulk create external entities import registers its entities with check, so a script that imports and then uses them no longer needs --no-check.

Change data capture

  • The major version is bumped when a tracked element's GUID changes. Dropping and re-creating a tracked entity with the same names kept revision 1.0 and its topic, while Studio Pro's CDC editor, which keys sources and members by GUID, rates it a Major change.
  • An association's nullability and length are no longer compared. An unchanged create or modify rated an 11.17 baseline as a Major change and moved the entity to a new topic, because mxcli compared facts Studio Pro derives for attributes only; an association's only compared fact is its multiplicity. mx check catches neither defect.

New checks for build errors that passed check and exec

All 14 gaps of the fourth parity sweep (f75–f98), each measured on MxBuild 11.16.1, one project per case, with clean controls:

  • JavaScript actions and non-persistent sources. MDL126 a JavaScript action called from a microflow (CE0009); a JavaScript action argument of the wrong type (CE0117) or a required one left out (CE0115); a data grid, list view or gallery with a database source on a non-persistent entity (CE8812); a database retrieve of one (CE0056).
  • Mappings and snippets. MDL127 an import or export mapping value whose JSON type does not match the attribute's (CE5015), or that names a missing attribute (CE1613); MDL128 import from mapping fed an Integer, a list or an ordinary object (CE0239); a snippet call argument of the wrong entity (CE0115), and one leaving out a parameter, where check now says what exec already refused.
  • Published REST and workflows. MDL129 a path or resource name starting with / (CE3471, CE0357), a resource declared twice (CE0331), two operations with one method and path (CE0358); an operation path naming a parameter its microflow lacks (CE1613, CE0352); a workflow call microflow or decision whose outcomes are not exactly the result's values (CE6686)

claude and others added 30 commits December 1, 2026 13:57
…E0009, CE0117, CE0115, CE8812, CE0056)

Check-gap sweep 4, batch A (f83 f84 f85 f91 f92 f93): each passed check -p
and exec, and MxBuild 11.16.1 rejected the project.

- MDL126: a JavaScript action called from a microflow (CE0009).
- JavaScript action argument types (CE0117): the action's primitive
  parameters are declared to the expression checker, as a Java action's
  are.
- A required JavaScript action parameter left out (CE0115). This was
  disabled as unmeasured; it is now measured, and an optional one left out
  builds clean.
- A data grid, list view or gallery with a database source on a
  non-persistent entity (CE8812).
- A database retrieve of a non-persistent entity (CE0056).

All 14 measured cases agree with mx.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
A microflow cannot call a JavaScript action (CE0009, now MDL126). The
nanoflow variant exercises the same converter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
check: JavaScript action calls and non-persistent database sources (CE0009, CE0117, CE0115, CE8812, CE0056)
…l parameters (CE5015, CE1613, CE0239, CE0115)

Check-gap sweep 4, batch B (f75 f76 f77 f78 f88 f89): each passed check -p,
and MxBuild 11.16.1 rejected the project (f88: exec refused it).

- MDL127: an import or export mapping value whose JSON type does not match
  the attribute's (CE5015). The match is exact: a JSON integer meets Integer
  or Long, a decimal Decimal, a boolean Boolean, a string String, Enumeration
  or DateTime. Values through a converter microflow are not judged.
- MDL127: a mapping value naming an attribute the entity does not have
  (CE1613).
- MDL128: `import from mapping` fed an Integer, a list or an ordinary object
  (CE0239).
- A snippet call argument of a generalization or an unrelated entity (CE0115).
- A snippet call leaving out a parameter with no data context to supply it,
  reported in exec's words.

28 mapping cases, 4 import inputs and 3 snippet arguments were measured,
one project per case, and agree with mx; the new control file builds clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
check: mapping value types, import-from-mapping input and snippet call parameters (CE5015, CE1613, CE0239, CE0115)
A combo box (or drop-down filter) bound to an association was accepted as
`Attribute:` too, and the readers of a script disagreed on it: exec wrote
the association, describe printed `Attribute:`, and the required-property
check saw the property unset and warned CE0642 (MDL-WIDGET56) on every
describe → check round trip, with a hint (`attributeAssociation:`) that is
itself refused.

describe now prints `Association:`; check and exec refuse `Attribute:`
naming the association a widget's mode binds (MDL-WIDGET57) with a message
naming the rewrite; the MDL-WIDGET56 hint names the MDL keyword. The
visitor keeps `Association: $Param.Module.Assoc` as the string the builder
reads, which worked only through the removed alias. Breaking: scripts using
`Attribute:` for an association must be rewritten.

Closes #2709

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
The roundtrip integration job failed on the two roundtrip tests whose combo
box wrote its association as `Attribute:`, now refused (MDL-WIDGET57):
TestDatabaseOverAssociationKeptUnderANamedDatasourceKey (which selects
association mode by the named optionsSourceAssociationDataSource key) and
TestReplacePluggableKeepsWhatTheStatementDoesNotState. roundtrip_mxcheck's
contact page and the 1648 test's describedCombo, describe's printed form,
used the same spelling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
Symptom: dropping and re-creating an entity a change data capture service
tracks (same names, same types, new GUIDs) and re-running `create or modify
change data capture service` kept the baseline and the source at 1.0, topic
cdc.<app>.<Entity>.1.{space}. mx check accepted it.

Cause: bumpCdcVersions matched baseline members by exposed name and compared
only the CDC type and the 11.17 facts. The entity GUID, each member's
PropertyGuid and an association's AssociatedEntityGuid were never compared.

Studio Pro 11.17.0's CDC editor (change-data-capture-editor/editor.js) keys
sources and members by GUID: getSourceModificationWithImpact and
getPropertyModificationWithImpact rate domainCanonicalGuid !==
baselineCanonicalGuid, and a changed associatedEntityGuid, as "Changed",
impact Major. A renamed attribute with the same GUID and exposed name is no
change, which the name-keyed rule already gives.

Change: identityChanged, called from bumpCdcVersions, treats a source whose
entity GUID, or a kept member whose GUID or TO-entity GUID, differs from the
baseline as breaking (major+1). factsChanged is untouched.

Measured on an 11.17.0 scratch project with the regression script:
main reports "Baseline version: 1.0", topic cdc.App.Order.1.{space}; the fix
reports 2.0 / cdc.App.Order.2.{space}; re-running the final statement stays
at 2.0. mx check 11.17.0: 0 errors both ways (mxbuild ignores the numbers, so
the stale version was silent).

Refs #2672

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82t3TXiBNijmizS5cpZ
Symptom: `drop odata client M.Client` (`drop consumed odata service`)
removed every external entity created from the client without saying
so, leaving pages and microflows with dangling references, and missed
entities imported `into` another module, which then failed mx check
with CE1613 "The selected consumed OData service 'M.Client' no longer
exists." at the entity.

Cause: dropODataClient ran its own cascade: it scanned only the
client's own module, called DeleteEntity directly (no reference
warning, no #1449 access-rule reconcile) and printed one line.

Change: the cascade keeps going (an external entity cannot exist
without its client) but finds the entities by RemoteServiceName in
every module's domain model, warns about each one's referrers through
warnEntityReferences, collects associationMemberModules before any
delete and reconciles them after, prints one "Dropped external entity"
line per entity with the associations that went with it, and ends with
a hint that `create or modify consumed odata service` + `create or
modify external entities` is how a contract is refreshed.

Measured with mx check 11.14.0 (Repro.Season into Repro, Other.Race
into Other, Other.Bet_Race and microflow Other.ACT_Races using it):
before, the drop printed only "Dropped OData client: Repro.F1" and mx
check reported CE1613 at Entity 'Other.Race' (orphaned external
entity); after, the output warns about ACT_Races and Bet_Race, lists
both entities, and the only error left is CE1613 at the retrieve in
ACT_Races, the reference the warning named.

Refs #2674

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82t3TXiBNijmizS5cpZ
…w to

The question in #2674: is the way to refresh a consumed OData
contract discoverable? It was not. The working flow (re-run
`create or modify consumed odata service`, which re-reads $metadata, then
`create or modify external entities from …`, which updates the external
entities in place) was written down only in the odata-data-sharing skill.
`mxcli syntax odata.consume` never mentioned refreshing, `mxcli syntax
refresh` found only the microflow REFRESH option, and the docs site had no
page on it. The statement that reads like the refresh,
`alter consumed odata service … set (MetadataUrl: …)`, only stores the URL
and printed nothing to say so; the reporter then dropped the client, which
deleted its external entities.

Change:
- alterODataClient prints a note when MetadataUrl is among the changed
  keys: $metadata was not re-read, and the two statements that refresh.
  Other keys print no note (control test).
- syntax odata.consume: a "Refreshing a changed contract" note, the
  summary mentions it, and refresh / metadata-changed keywords, so
  `mxcli syntax refresh` lists odata.consume.
- docs-site: reference/odata/refresh-odata-contract.md (steps, what the
  output verbs mean, what does not refresh), and the missing
  drop-odata-client.md that the README already linked to, cross-linked;
  both registered in SUMMARY.md.
- odata-data-sharing skill: dropping deletes the external entities;
  ALTER prints the note.

Measured on a scratch 11.14.0 project: ALTER … MetadataUrl prints the
note, ALTER … Timeout does not; the create-or-modify pair prints
"Unchanged OData client" and "0 created, 2 updated".

Refs #2674

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82t3TXiBNijmizS5cpZ
Symptom: a change data capture service whose 11.17 baseline holds
IsNullable false, or no IsNullable key, for an association member was
rated a Major change by an unchanged `create or modify`: "Modified
change data capture service", and the entity moved to revision 2.0,
i.e. a new topic cdc.<App>.<Entity>.2. mx check stays clean, so no
build catches it.

Cause: factsChanged compared IsNullable and MaxLength for every member,
while mxcli writes an association's as constants (true, 0). Studio
Pro's CDC editor (11.17.0 editor.js) derives neither for an association
(getAssociationProperties), reads a stored isNullable back as undefined
for an ArrayOfInt64 member (getProperties), and compares a fact only
when both sides have it.

Change: an association's only compared fact is its multiplicity.
IsNullable and MaxLength are still written (true, 0, what the stored
units hold), so the property set is unchanged.

Measured on 11.17.0, on a `mxcli new --version 11.17.0` project with a
service over an entity with an association, then the association
member's IsNullable edited in the stored unit:
- mx check with IsNullable false, the key removed, or MaxLength 7 on
  the association: 0 errors. The same edit on an attribute: CE1585.
- re-run, before: Modified, Order revision 2.0, service 2.0.
- re-run, after: Order stays 1.0, mx check 0 errors, and the next run
  is "already in sync" with the unit byte-identical. The first run
  still rewrites once, normalising IsNullable to true.
- control: String(20) -> String(40) on an attribute still moves Order
  to 2.0.

Refs #2672

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82t3TXiBNijmizS5cpZ
…24rqgv

fix!: a pluggable widget's association has one spelling, Association:
A `create or modify association` with no `on delete` clause, written only
to set documentation, reset a stored `on delete restrict error message`
to keep-references and dropped the message. The AST could not tell an
unstated behaviour from `on delete set null`, the zero value. The visitor
now records whether a delete behaviour was stated, and OR MODIFY replaces
the stored one only then, as it already did for storage and export level.

Fixes #2713

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
Symptom (#2674, defect 2): "`check --references` doesn't know
about entities that `create external entities from …` will create, so a
script that imports and then uses an entity fails without `--no-check`."
exec refused such a script: "microflow 'R3.ACT_Seasons' has reference
errors: - entity not found: R3.Season (referenced by retrieve)".

Cause: the script context recorded a bulk import only as a module-level
escape (externalEntityModules), since the entity names live in the
contract. The association, alter-target and view checks honoured it; the
microflow entity check (sc.entities) did not.

Change: validateProgram now reads the contract each bulk import reads -
the MetadataUrl of a client created earlier in the script, resolved
against the project directory with normalizeMetadataURL, else the stored
client's cached $metadata - and registers the entities it selects. The
ENTITIES filter and entity naming are extracted from createExternalEntities
into bulkImportSelection / bulkImportType.mendixName and shared, so check
and exec cannot disagree. A contract the check cannot read (missing file,
HTTP URL) registers nothing: the error stands, with the reason appended.
Attributes are not registered (unchanged: not judged for these entities).

Measured on a fresh 11.14.0 project with the F1 contract: main refuses the
script ("entity not found: R3.Season … Refusing to execute"); the fixed
binary runs it ("1 created", "Created microflow: R3.ACT_Seasons") and
mx check reports 0 errors. Plain `mxcli check` without a project prints
the same output before and after. Tests fail with the collector stubbed.

Fixes #2674 (defect 2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82t3TXiBNijmizS5cpZ
…, CE0331, CE0358, CE0352, CE6686)

Check-gap sweep 4, batch C (f80 f81 f82, and the CE6686 outcome half that
MDL-WF06 left to the reference pass): each passed check -p and exec, and
MxBuild 11.16.1 rejected the project.

- MDL129: a published REST service path starting with a slash (CE3471), a
  resource name starting with one (CE0357) or declared twice (CE0331), and
  two operations with one method and path (CE0358). A trailing slash or a
  path parameter's name does not tell two paths apart; case and method do.
- An operation path naming a parameter its microflow lacks, matched case-
  sensitively (CE1613, CE0352).
- A workflow call microflow or decision whose outcomes are not exactly the
  result's values (CE6686): true and false, or each enumeration value plus
  ''. A call microflow returning a Boolean may have none, a decision may
  not; one returning nothing takes none; an outcome that is no value of the
  enumeration is CE1613.

All 31 measured cases (27 new, 4 from the workflow batch) and the three
fixtures agree with mx; the new control file builds clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
…reate

Bump the CDC major when a tracked element's GUID changes
…n-nullable-not-breaking

# Conflicts:
#	.claude/skills/mendix/change-data-capture/SKILL.md
…-entities

Make drop odata client list and fully drop its external entities
…resh-discoverable

# Conflicts:
#	.claude/skills/mendix/odata-data-sharing/SKILL.md
…-entities

Let check --references see the entities a bulk OData import creates
…24rqgv

fix: create or modify association keeps an unstated delete behaviour
The writer hard-coded AriaRequired false on every text box, text area,
date picker and radio button group, and Autocomplete true /
AutocompletePurpose On on every text box. check refused the properties
and describe never printed them, so rewriting a page or snippet from MDL
reset what Studio Pro had set. They are now parsed, written as given
(Studio Pro's defaults when unset) and described when not the default;
an unknown autocomplete purpose is refused by check and exec alike.

Fixes #2710

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
…-breaking

Compare only multiplicity for a CDC association's facts
Make refreshing an OData contract discoverable
…24rqgv

fix: an input's AriaRequired and a text box's autocomplete round-trip
…ivity

A custom error handler whose last statement was an if with exactly one
terminating branch was wired as a retry loop: the continuing branch
looped back to a merge in front of the guarded activity, which then ran
again for as long as it kept failing. The heuristic predates merge/join;
nothing in the source asked for a loop, and the syntax help says such a
handler continues after the activity. It is removed with the redirect
field it used. A retry is written with merge/join, as describe prints it.

Fixes #2733

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
…24rqgv

fix!: an error handler ending in a one-sided if rejoins after the activity
check: published REST paths and workflow outcome sets (CE3471, CE0357, CE0331, CE0358, CE0352, CE6686)
@ako
ako merged commit 4097228 into mendixlabs:main Dec 1, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment