Skip to content

Sync ako/mxcli: export AsyncAPI contract; 7 upstream fixes (run ports, marketplace, legacy grid buttons, CRLF translations, enum captions, parse_xpath); dated nightlies - #1899

Merged
ako merged 50 commits into
mendixlabs:mainfrom
ako:main
Nov 19, 2026

Conversation

@ako

@ako ako commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Syncs ako/mxcli:main into upstream: 23 commits since #1892 — 7 upstream issues fixed, an AsyncAPI contract export that closes the two-app business events loop, dated nightly releases, and a new domain-model lint rule.

Business events: export a published service's contract

mxcli export contract <Module.Service> -p app.mpr -o contract.yaml renders the AsyncAPI document app B needs to consume app A's events — before, that meant opening Studio Pro and clicking "Export AsyncAPI Document". Nothing serves this document (a publisher stores an empty Document), so it has to be rendered. Measured end to end across two project copies: app A exports, app B authors a consumer from the file alone, and both agree on the channel id the broker derives the topic from. A change data capture service's baseline GUIDs, which read back empty from the vendored model types, now decode.

run and marketplace

Pages, enumerations, translations

check and lint

  • parse_xpath reads true() / false(): the Boolean literal ended the parse and dropped the rest of the constraint; a partial parse is now reported as recovered. Fixes lint: parse_xpath drops everything after true() / false() #1894
  • New MPR016 reports entities whose boxes overlap on the domain model diagram — the sibling of MPR008 for microflows.
  • check judges the values of an enumeration split (CE0079, CE1613, CE0771), and refuses a mapping custom handler that doesn't name exactly its microflow's parameters (CE1613, CE0277).

Other

  • Each nightly is published under its dated tag as a pre-release (the 30 most recent kept), so the dated version mxcli prints can be downloaded, and the bootstrap script's advice for a nightly stamp names a tag that exists.
  • create external entities names a colliding navigation association <Parent>_<Navigation> instead of a numeric suffix (Product_Category, not Category_2).
  • An OpenAPI query parameter is previewed as the import stores it (text), not the spec's type.
  • The verify-gate proposal gains a lint baseline, discoverability and benchmark evidence

claude and others added 30 commits November 18, 2026 09:51
Part E of #2384, and the piece that closes the two-app loop. `ContractFile:`
landed in part B, but nothing in mxcli could produce the file app A has to hand
app B — that still meant opening Studio Pro and clicking "Export AsyncAPI
Document".

    mxcli export contract CdcPublish.OrdersEventService -p appA.mpr -o contract.yaml

Measured end to end across two separate project copies: app A exports, app B
authors a consumer from the file alone, and the two then agree on the channel —
which is what the broker derives the topic from:

    appA  CdcPublish.OrdersEventService    f2477dc90f714d69bb12df0df1ee9cce  PUBLISH
    appB  BusinessEventsClient.OrdersFromAppA  f2477dc90f714d69bb12df0df1ee9cce  SUBSCRIBE

Nothing serves this document — a publisher stores an empty Document, so unlike a
published OData or REST contract there is no running app to fetch it from. It
has to be rendered, which is why part E starts here rather than with the fetch
backends.

mdl/businessevents.RenderAsyncAPI writes the YAML by hand: Studio Pro quotes
`title: "X"` but not `operationId: x`, and single-quotes `$ref`, and no general
marshaller reproduces that mix. The CloudEvents and Kafka trait blocks are
copied verbatim from the export, including the literal \r\n in their summaries,
which are YAML escapes and not raw carriage returns.

Evidence: the golden test renders from the model and compares byte for byte with
Studio Pro's own export of that model (testdata/, copied from the proposal's
fixtures). Anything weaker — "valid YAML", "parses as AsyncAPI" — passes against
documents that would bind a subscriber to the wrong channel or payload. Three
perturbations (document version, operationId prefix, message title suffix) each
fail it at the exact line. The export from the live project is byte-identical to
the committed fixture too, so the renderer and the reader agree.

Only Long is measured (#2384 §9.1): the fixture carries two Long attributes and
nothing else, and the remaining types are inferred from format strings in
Mendix.Modeler.BusinessEvents.dll. The renderer refuses them, naming the
attribute and pointing at ContractFile, because a subtly wrong contract is worse
than a refused one — the consuming app imports it and finds out at deploy time.
Settling the rest needs one Studio Pro export with an attribute of each type.

Not in this slice: the fetch backends for published OData and REST contracts
(§5.5 — four of five OData artifacts are fetched from a running app), and
ContractFrom:, which can now reuse this renderer.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qQLKUyoXXGmbmX68t
…ect open

The per-write Studio Pro guard refused every write of the update one by
one, and the caller then reported the project as possibly mid-update.
The lock is now checked once before anything is built or written, and
the refusal is marked as not started.

Closes #2366

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
run --local read constants and JVM options from the chosen configuration
but its ports only from the flags, so the app started on 8080/8090
whatever the configuration said. The flags now override the
configuration's ports instead of replacing them with defaults.

Closes #2365

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
run, run status/stop/wait/restart exited through os.Exit, which skips
runCLI's session close, so diag loop-report counted every call as a
vanished process with no time. They now exit through exitProcess, which
records session_end with the exit code first.

Closes #2360

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
Rest$QueryParameter has no DataType, so the import stores every query
parameter as text and describe reads it back as String, while the
contract preview printed the spec's type. The preview now shows what
the import writes.

Closes #2353

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
…ion>

create external entities fell back to a numeric suffix when a navigation
property's name was already an entity, so Product.Category became
Category_2. The fallback is now Product_Category, with a number only if
that is taken too.

Closes #2354

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
… microflow's parameters (CE1613, CE0277)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
… and install's repairs

The reference cache dropped widgets/, so a cached reference described
pluggable widgets generically, and the reference never got the widget
and design-property repairs install runs on the app. Both read as local
edits of an untouched module. The cache now keeps widgets/ (format f3)
and a freshly built reference is repaired before it is cached.

Closes #2367

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
feat(businessevents): export a published service's AsyncAPI contract
…avigation> name

TestModelOnlyCopyKeepsWhatIsRead pinned widgets/ out of the reference cache,
which #2367 keeps on purpose; the splice test named the colliding Unit
navigation Unit_2, which #2354 now names QuantityParameterType_Unit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
Part C of #2384 begins with its prerequisite: the vendored gen cannot read a
change data capture service. Measured on ako/TestApp 619864b (Mendix 11.16.1),
8 of 8 GUIDs in the baseline came back as the empty string — EntityGuid on each
source, PropertyGuid and AssociatedEntityGuid on each property — while
everything else decoded correctly, so nothing looked wrong unless the GUIDs
were printed.

Those GUIDs are the DATABASE's identity for the tracked entity and its members:
mendixsystem$entity.id and mendixsystem$attribute.id hold them verbatim. A write
path built on an empty read would detach every tracked entity from its table —
the failure class CLAUDE.md puts first, and one that no mx check and no build
reports.

Cause: the gen typed EntityGuid/PropertyGuid as Primitive[string] with
DecodeString, but Mendix stores every GUID as BSON binary subtype 0, and
DecodeString does `s, _ := val.StringValueOK()` — discarding the ok flag, so a
binary value silently yields "".

They are now ByIdRef[element.Element], decoded the way domainmodels already
decodes ParentPointer (StringValueOK, then BinaryOK + codec.BinaryToUUID).
ByIdRef also encodes correctly, since the codec turns a non-empty element.ID
into binary. The accessors keep their string signatures, so no caller changes.

#2384 §4 listed four properties missing from the gen outright; all four are
added here with sequential Bind indices and SetProperties entries:

  EntityChangeDataCaptureService  AppName
  EntityChangeSource              VersionedSourcePointer
  Attribute/AssociationProperty   VersionedPropertyPointer
  VersionedProperty               AssociatedEntityGuid

The fifth defect was in a property that was already present, which is why the
schema diff behind §4 did not find it — the values had to be printed.

With this the fixture reads completely: AppName=TestApp, every GUID resolved,
Order_Customer's AssociatedEntityGuid equal to Customer's EntityGuid (confirming
§4's claim that it is the TO entity), and every live->baseline pointer intact.

types.go is generated and says DO NOT EDIT, but the generator is not in-tree, so
handadded_test.go guards the additions: a regeneration that drops them fails
loudly instead of quietly returning "". Control: restoring DecodeString makes
each test fail with `= ""`, the reported symptom. The whole modelsdk suite,
including the codec round-trip guards, stays green.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qQLKUyoXXGmbmX68t
check: refuse a mapping custom handler that does not name exactly its microflow's parameters (CE1613, CE0277)
…24rqgv

Batch F: marketplace lock and diff false edits, run ports and loop-report, OpenAPI query preview, OData association names
fix(modelsdk): CDC baseline GUIDs read back empty
check: judge the values of an enumeration split (CE0079, CE1613, CE0771)
…se as recovered

In XPath mode the Boolean literal was returned before the call check, so
the '()' after true/false ended the parse and dropped the rest of the
constraint; parse_xpath discarded the E014 that said so. true()/false()
now parse as Booleans, and an E014 parse returns a recovered root.

Closes #2398

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
…endings

A describe translations file edited by a tool that normalises line
endings lost the CR of every CRLF source, and create translations then
matched none of them. Sources now match exactly first and then with
CRLF read as LF, and the translation takes the source's line breaks.

Closes #2383

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
…tion

create enumeration and alter enumeration add value stored an empty
caption for a value written without one, a blank option nothing
reported. The omitted caption now defaults to the value's name, as
Studio Pro fills it; an explicit '' is kept.

Closes #2397

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
…elds under NewButtons

Forms$GridControlBar.Items and Forms$SearchBar.Items are stored as
NewButtons, but the widget finder, describe and the catalog read Items,
so the buttons were 'not found', unlisted and absent from show widgets.
All read the stored key now; describe also prints each button's caption
and action.

Closes #2382

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
…tly-stamp advice that can be followed

The nightly workflow kept only a rolling nightly release, so the dated
version mxcli prints could not be downloaded and the bootstrap script's
MXCLI_TAG advice gave a 404. Each nightly is now also published as a
pre-release under its dated tag (the 30 most recent kept), and the
bootstrap advice for a nightly stamp names both the dated tag and
MXCLI_TAG=nightly.

Closes #2359

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
…24rqgv

Batch G: parse_xpath true()/false(), CRLF translations, enum captions, legacy grid buttons, pinnable nightlies
claude and others added 20 commits November 18, 2026 21:02
Running `mxcli lint` or `refresh catalog full` against a fixture writes
per-widget skill docs into that project's .claude/skills/widgets/ (43 files
for testdata/pedapp), which showed up as untracked noise in the work tree.

testdata/expr-checker/.gitignore already ignores its own copy with this
rationale; testdata/pedapp/.gitignore did not. Fixed at the root instead of
per-fixture, scoped to testdata/, so any fixture a lint or catalog run opens
is covered — the same reasoning as the **/.mxcli/unit-types.idx entry above it.

Verified: the fixture's generated files are ignored, the repo's own .claude/
is unaffected, and no tracked file becomes ignored.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82sY9fcHtMuZcMNRm2B
Any command that opens a fixture writes .mxcli/ beside it (catalog.db, the
unit index, the unit-contents cache). testdata/pedapp/.gitignore ignores its
own; testdata/testapp-views and testdata/expr-checker have no entry, so running
lint against them leaves an untracked directory behind. The root ignored only
**/.mxcli/unit-types.idx, one file inside it.

Anchored at /testdata/ deliberately, NOT **/testdata/**:
modelsdk/mpr/testdata/v1-project/.mxcli/catalog.db is tracked as a fixture, and
a recursive pattern would shadow it.

Verified: the byproduct is ignored, that tracked catalog.db is still visible to
git, and `git ls-files | git check-ignore --stdin` is empty, so no tracked file
became ignored.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82sY9fcHtMuZcMNRm2B
… model

Closes #2406.

The sibling of MPR008, which does this for microflow activities. The diagram is
the first thing someone opening an unfamiliar app reads, and a box hidden
behind another is a member list they never see. Neither Studio Pro's check nor
mxbuild reports it, because the model is perfectly valid.

A pair is named as a pair; entities that collide transitively are ONE finding
however large the cluster, so a model with every entity on one spot reports
once rather than as 325 pairs. The finding names the repair that already
exists: `mxcli layout --only-overlapping`.

Geometry is dmlayout's own estimator (an entity stores only its top-left
Location; Studio Pro derives the box when it draws, so the size is estimated
from the name and member list), so the rule and the placer agree by
construction instead of being kept in step by hand.

The predicate is new and deliberately NOT the placer's. Rect.overlaps kept
boxes a 20px clearance apart, which is what placing needs and wrong for a
check: two entities 10px apart are badly laid out and do not overlap, and a
finding has to be true. It is now Rect.TooClose (unchanged behaviour, same
single call site in clear()), beside a new Rect.Intersects with no margin.
A test pins the difference and fails if the rule is ever switched over.

Unlike MPR008 this does not skip the origin: an unpositioned activity defaults
to (0,0) so there it means "no position recorded", while entities are placed on
every create path, so entities sharing a position IS the defect.

Platform modules are skipped via the new LintContext.OwnedModuleNamesByID. A
rule that reads the MODEL does not inherit the notPlatformModule WHERE clause
that protects catalog-backed rules, so before that existed this reported 41
System entities, naming FileDocument and HttpRequest exactly as QUAL002 once
did. Source cannot distinguish System (empty for it as for the user's own
modules), hence the module-ID test. Recorded as a finding, because the rules
proposed in #2403, #2405 and #2407 all read the model and start out the same way.

Measured
- 0 findings on testdata/pedapp and testdata/testapp-views.
- 0 findings on 24 entities of varied name length and 0-21 attributes created
  with no @position, so dmlayout's auto-placement is clean; full `layout`
  (Plan) and `layout --only-overlapping` are clean too, and idempotent.
- Planted overlaps -- a pair, a tall entity reaching the box below it, and a
  pile of four -- are each reported, the pile as one finding; then
  `layout --only-overlapping` moves 5 of 10 entities and lint returns to 0,
  so detector and repair agree.
- Correction to the issue's hypothesis: dmlayout is NOT the source of the
  overlaps that motivated the rule. The unguarded path is an explicit
  @position written by a script, which nothing warns about.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82sY9fcHtMuZcMNRm2B
docs(proposal): verify gate — lint baseline from day one, discoverability, benchmark evidence
lint MPR016: entities whose boxes overlap on the domain model diagram (+ two testdata ignore fixes)

Closes #2406.
external entities: import a key the service does not allow filtering on as not filterable (CE6630)
Refs #2403. Blocked on #2417 for a project's first run.

A decision tests a flag whose every reachable value is the same, so the branch
it guards is unreachable and the flow reads as though it has a safety interlock
when it has none. Studio Pro and mxbuild both pass it: the model is valid.

The test is the attribute's REACHABLE VALUE SET -- its default plus every
literal any Create/Change activity assigns -- not "is it ever written". #2403
described it as "read but never written", but the defect it cites is a reset
flag that IS written, only ever to false, so a "never written" rule would have
missed the case the issue was raised for. The inverse control matters as much:
a default of true with the only write false is TWO values, so that guard can
change state once and is correctly not reported.

A write the rule cannot see reads as no write, so four exclusions, each a
measured false-positive source: bound to a page widget (a user may type into
it, and #2403 called this the decisive one), assigned from an expression rather
than a literal, calculated, or not read in any condition. Writes are collected
from every module including Marketplace ones while only the project's own
attributes are reported -- a Marketplace flow writing an app's attribute is
rare, but counting it as no write would be a false positive.

Boolean only for now: enumerating "the literals I could see" is a far weaker
claim for other types. The mirror verdict, written but never read, is not in
this rule.

Two silent failures found on the way, both recorded as a finding:

1. linter.CatalogRequirer is OPTIONAL, so a rule that does not declare
   RequiredCatalogMode gets a fast catalog, where activities / widgets /
   xpath_expressions are never written -- the rule then finds no conditions and
   reports a clean project. Its own doc warns of this ("silently returning
   empty results"). Now declares CatalogFull, with a test.

2. Under that, ctx.AttributesFor fails with "no such table: attributes"
   whenever lint BUILDS the catalog rather than loading it (#2417), and once
   that error is recorded the context stops answering later reads. So the rule
   refuses rather than passing: it separates "no entities, nothing to check"
   from "entities but no readable attributes" and reports the latter as a
   linter.RuleFailure naming #2417. That guard is to be DELETED when #2417 is
   fixed; it is a workaround, and it only protects the one rule that knows.

Measured
- 13 tests, including the inverse control (a flag written both ways is not
  reported) and each of the four exclusions.
- Positive control, which is what caught (1) and (2): a fixture of one entity
  and three microflows -- a guard reading the flag, a flow writing only false,
  and a control flag written both ways. The rule reports the first and ignores
  the control. Before the fixes it reported NOTHING on that fixture, while two
  real projects showed zero false positives -- which looked like success and
  was a rule that could never fire.
- 0 findings on testdata/pedapp and testdata/testapp-views.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82sY9fcHtMuZcMNRm2B
First step of PROPOSAL_verify_gate.md (#2333): ParseCheckOutput, a location
class per finding, the measured MxBuild report stage, a message-free Key, and
a Verify cross-check against mx's own error count.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82stfDEB1TGfJLVwUxc
`SQL <alias> GENERATE CONNECTOR INTO <Module>` emitted bare table names, so
none of its queries could run against the database they were generated from:

    SELECT id, CustomerNumber, Name, Email, Active FROM customer
    ERROR:  Table with name customer does not exist!
    Did you mean "cdcpublish.customer"?

SHOW TABLES and SHOW VIEWS return (table_schema, table_name) and both readers
kept only the name, so TableSchema.Schema -- a field that already existed --
was never populated and the emitter had nothing to qualify with.

The quieter half of the same defect: a name two schemas share was refused as
ambiguous by the describe step, and the reader's `continue // skip tables that
fail` swallowed it, so the object vanished from the output with no warning.
Two apps publishing CDC for an entity of the same name is the ordinary case.

Both readers now go through one `tableAddresses`, `ReadTableSchema` splits a
qualified name into Schema and Name so the Mendix entity is still called after
the bare name, and the emitted query addresses `ts.QualifiedName()`.

The whole pipeline is tested without PostgreSQL -- modernc SQLite, DriverPostgres
so the real query templates run, and an attached information_schema, the harness
the IMPORT ... LINK fix established. The repo's other DB-backed sql tests are
gated on MXCLI_TEST_PG_DSN and skip in CI, which is how #808 shipped
green. Controls, each on the end-to-end test: emitter back to ts.Name leaves
every FROM unqualified; reader back to row[1] does the same and additionally
reports `1 entities, want 3`.

Verified end to end against a DuckGraphLake lake serving Mendix entity CDC,
where each publishing app gets a schema of its own: 6 of 6 generated queries
run, where 5 of 6 failed before. The one that passed before is a table in
`main`, in the search path -- which is why a single-schema database never
showed the defect.

Fixes #2414

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011oK82qQLKUyoXXGmbmX68t
fix(sql): address a generated connector's tables by their schema
docs(proposal): verify gate — MxBuild staging and an optional fast mxcheck pre-stage
feat(docker): parse mx check output into structured findings
lint MPR017: a Boolean guard that can only ever hold one value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment