Skip to content

Sync ako/mxcli: sql read-only by default; marketplace --no-baseline keeps cross-module associations; re-runnable grants and JS actions; check/lint fixes - #1888

Merged
ako merged 23 commits into
mendixlabs:mainfrom
ako:main
Nov 17, 2026

Conversation

@ako

@ako ako commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Syncs ako/mxcli:main into upstream: 15 commits since #1884 — mxcli sql read-only by default, a marketplace update that no longer drops other modules' associations silently, scripts that re-run without writing, and check and lint fixes. 1 upstream issue fixed.

mxcli sql

  • Read-only unless --write is given. mxcli sql passed every statement to the database, and a DELETE printed "(0 rows)". A statement that is not a read is now refused; a read runs in a read-only transaction that is rolled back, and --write allows changes and reports the rows affected.
  • --describe schema.table matches schema and table separately on PostgreSQL and SQL Server (it printed an empty column list), a table that isn't found is an error, and an unqualified name in several schemas is refused with the candidates instead of merging their columns.

marketplace update --no-baseline

The search for cross-module associations an update deletes lived inside the baseline comparison --no-baseline skips, so the update removed associations other modules own into the module without naming them. They are now found under --no-baseline too: saved with --save-edits, refused without --force, and listed after the update. Fixes #1883

Scripts that re-run without writing

  • A grant whose XPath differs only in whitespace merges with the stored rule: the upsert compared constraints byte for byte, so the same constraint wrapped over lines added a second identical rule on every run. A merged rule keeps its stored spelling.
  • A JavaScript action's file is written exactly as mxbuild writes it — banner, Big import, documentation, [optional] parameters, MxObject types, enumeration unions and CRLF, measured on 11.12.6 — so files mxcli writes survive an mxbuild build unchanged, and a re-run no longer drops the action's documentation.
  • The Placeholder Pattern uses create snippet|page … if not exists: the documented plain create failed on a second run, and the create-or-modify variant scripts used instead rebuilt the finished snippet with new element ids every run.

check, lint and pages

  • MDL-RETRIEVE03 covers a list returned where the flow returns one object: under mdl 1, retrieve … limit 1 binds a list, and return $Item from a microflow returning the entity passed check while mx check reported CE0117.
  • alter page … set (visible: roles (…)) writes the module roles, as create page does, instead of storing roles (…) as an expression (CE0117).
  • SEC012 skips data hidden from the user role by Visible: roles, which mxbuild doesn't check for CE2729, so lint no longer reports errors mx check doesn't.

Check diagnostics research

Proposal updates measured on 11.16.1 with six single defects and all 30 ordered pairs: MxBuild reports errors in stages (an unresolved reference, CE1613, hides every other error; a duplicate variable hides the rest of its microflow; an undefined variable hides type and return errors), while Mendix CLI 2's mendix check reports all stages. make mask-matrix (scripts/maskmatrix) reproduces the staging on a copy of a healthy project

claude and others added 23 commits November 17, 2026 15:37
The access-rule upsert compared the XPath constraint byte for byte, so the
same constraint wrapped over lines, or stored on one line by an older
writer, added a second identical rule on every run. Constraints are now
compared ignoring whitespace outside string literals, and a merged rule
keeps its stored spelling, so the re-run writes nothing.

Closes #2355

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
The resolve-forward-references skill created the placeholder with a plain
create, which fails on a second run, and the create-or-modify variant a
script used instead shrank the finished snippet and rebuilt it with new
element IDs on every run. The placeholder step is now
`create snippet|page … if not exists`, which the executor already honours:
the second run skips it and writes nothing.

Closes #2358

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
mxcli's JS generator never matched mxbuild's file, and since #2131 every
re-run regenerated mxbuild's file in mxcli's shape, dropping the action's
documentation. The generator now writes mxbuild's bytes, measured on
11.12.6 for every type: banner, Big import, documentation, [optional]
parameters, Big for numbers, MxObject/MxObject[], enumeration value
unions and CRLF. Files mxcli writes survive an mxbuild build unchanged.

Closes #2357

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
A widget limited by ConditionalVisibilitySettings.ModuleRoles to module
roles the user role does not hold is not checked by mxbuild for CE2729,
so SEC012 reported errors mx check did not. The rule now reads the
page's stored widget tree and drops a finding when every occurrence of
the entity or attribute sits under such a restriction.

Closes #2356

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
CE0136 x3 and CE0535 x2 are cascades of an unresolved entity and layout reference
(a control each clears them); CE6083 x1 needs a theme, which the stripped
TestApp project lacks. None is a check to port, and none a CLI 2 false positive on
a healthy project. Run mendix check on a project whose references resolve.

Refs #1258.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
Measured on 11.16.1 with six single defects and all 30 ordered pairs: a reference
that does not resolve (CE1613) hides every other error in every document; a
duplicate variable (CE0111) hides the rest of its microflow; an undefined variable
(CE0109) hides the type, return-in-loop, missing-value and no-return errors, which
are reported together. No pair is order-dependent. mendix check reports all stages.

Refs #1258.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
…kes round-trip

Their access rules have multi-line XPath constraints; with the grant now
matching the stored rule regardless of whitespace, both entities pass
getput and putget, and the allowlist may only shrink.

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

Batch D: grant XPath whitespace, re-runnable placeholders, JS stubs as mxbuild writes them, SEC012 role visibility
docs(proposal): classify mendix check's extra findings; MxBuild reports in stages
…ules own into the module

The search for cross-module associations the update deletes needs only
the project, but lived inside the baseline comparison --no-baseline
skips, so the update removed them without naming them. They are now
found under --no-baseline too: saved with --save-edits, refused without
--force, and listed after the update.

Closes #2368

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
mxcli sql passed every statement to the database, and a DELETE printed
'(0 rows)'. A statement that is not a read is now refused, a read runs in
a read-only transaction that is rolled back, and --write allows changes
and reports the rows affected.

Closes #2362

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

--describe sales.customers compared table_name to the whole argument on
PostgreSQL and SQL Server and printed an empty column list. Schema and
table are now matched separately, a table that is not found is an
error, and an unqualified name in several schemas is refused with the
candidates rather than merging their columns.

Closes #2361

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

Both assigned to an undeclared $Bad. MxBuild reports an undefined variable (CE0109)
before it reports a type or expression error (CE0117), and CE0109 hides it, so the
fixtures did not demonstrate the build failure their headers describe.

Measured on MxBuild 11.16.1 with the variables declared: each of the six '/' division
statements and the dateTime() call with variable arguments is CE0117; the same
microflows with div and with literal arguments are clean. check still refuses both
files with MDL045 (x6) and MDL046, and no longer also reports MDL098.

Refs #1258.

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

Under mdl 1, retrieve ... limit 1 binds a list, and return $Item from a
microflow returning the entity passed check and exec while mx check
reported CE0117 at the End event. MDL-RETRIEVE03 now covers the return.

Closes #2364

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

The alter set path read visible: as a widget expression, so roles (...)
was stored as the visibility expression and mx check reported CE0117.
The visitor now splits roles (...) [and <condition>] as create page does,
and the page mutator writes ConditionalVisibilitySettings.ModuleRoles.

Closes #2371

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
Writes every defect and every ordered pair into a copy of a healthy project,
checks once with MxBuild (and optionally Mendix CLI 2), and reports which
errors one checker hides until another is fixed. Reproduces the staging
documented in the check-diagnostics proposal.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
The example returned an unranged retrieve (a list) from a microflow
returning HR.Employee: CE0117 in mxbuild, and now MDL-RETRIEVE03 in check.

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

Batch E: no-baseline dependents, read-only sql, sql describe schema.table, list returned as object, alter page visible roles
test(bug-tests): declare the variables in the ledger-17 and ledger-21 negative fixtures
tooling: add scripts/maskmatrix (make mask-matrix)
@ako
ako merged commit 521d456 into mendixlabs:main Nov 17, 2026
15 checks passed
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.

marketplace update --no-baseline removes associations other modules own into the module without naming them

2 participants