Skip to content

Sync ako/mxcli: check flags undefined return/expression variables and cross-module visibility roles; traceability --junit; OQL on Mendix 9 - #1884

Merged
ako merged 27 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: 11 commits since #1878 — check catches more undefined variables and cross-module roles that fail the build, plus report and OQL fixes.

check: catch what the build refuses

Each measured on MxBuild 11.16.1 first:

  • MDL097: returns T as $R when a path ends the flow without $R. MDL003 exempts the AS clause because the end event returns $R, which only holds while $R has a value where the flow ends; a path off the end with $R never defined is CE0109 (CE0108 when $R is defined only in a branch or loop). Checked over 15 flows, microflow and nanoflow; a sweep of every .mdl in the repo (1,658 flows) found two real cases.
  • MDL098: an expression that reads a variable nothing defines (return $Nope + 1), CE0109 at build. $currentUser, $currentSession, $latestError, $latestHttpResponse and $latestSoapFault count as defined everywhere, $currentIndex and $currentObject in their own context.
  • MDL-GRANT04: Visible: roles (…) naming a role of another module. A widget's role visibility can only name module roles of its own page, snippet or layout; another module's role passed check and exec, and the build reported CE0149 ("reselect roles"). Measured over 17 documents.
  • Visible: roles (…) on a tab page is no longer refused under mdl 1 (MDL-WIDGET44): the builder writes it, describe prints it back and MxBuild accepts an own-module role there.

Reports and OQL

Other

  • The java-dependencies skill covers libraries that register themselves with the JVM: JDBC drivers (DriverManager doesn't see a userlib driver) and DuckDB community extensions.
  • The agentbench hot-apply check compares the step's two commands against a floor, not another step's single sample.
  • actions/upload-artifact 4 → 7 in the nightly workflow (Dependabot)

claude and others added 27 commits November 17, 2026 05:30
…ithout $R

MDL003 exempts the AS clause because the end event returns $R, which holds only
while $R has a value where the flow ends. A path off the end with $R never
defined is CE0109 on MxBuild (CE0108 when $R is defined only in a branch or
loop); a top-level declare is clean. Measured on 11.16.1 over 15 flows,
microflow and nanoflow. Guarded by bodyReturns and lastStmtIsReturn.

A sweep of every .mdl in the repo (1658 flows, 684 with an AS clause) finds two
hits, both correct. docs-site tutorial snippet fixed: it declared an AS
variable it never defined.

Refs #1258.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v4...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
… defines

return $Nope + 1 with $Nope defined nowhere passed check and exec, then failed
the build with CE0109. MDL098 joins the $names an expression reads (new
exprcheck.VariableReferences) with the names the flow defines (params plus every
statement's producers). $currentUser, $currentSession, $latestError,
$latestHttpResponse, $latestSoapFault, $currentIndex and $currentObject count
as defined everywhere: measured on MxBuild 11.16.1, the first five are accepted
in every position, the last two only in their own context (the rule is looser on
purpose).

A sweep of every .mdl in the repo (1658 flows) finds three hits, all correct.

Refs #1258.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
feat(check): MDL097 flags `returns T as $R` when a path ends the flow without `$R`
feat(check): MDL098 flags an expression that reads a variable nothing defines
…pload-artifact-7

ci: Bump actions/upload-artifact from 4 to 7
…her step

Nightly #116 failed in TestRun_RuntimeSessionRunsArmsInTurnAndAlwaysStops:
"hot-apply took 72 ms against 108 ms for a one-command step, want the two
commands summed". The check compared one sample of a two-command step with
one sample of a one-command step, ~30 ms a command, so a stall in the
one-command step's single run failed it.

The candidate's two hot-apply commands now sleep 300 ms more each (the fake's
slowOn takes "a|b" alternatives), and the step must take at least the 600 ms
they sum to: a stalled runner can only raise it, while a step that timed one
command alone reads ~330. Control: with runStep keeping only the last
command's wall time, it fails with "hot-apply took 335 ms". Modelling stalls
in the fake (a 30% chance per command of up to 300 ms), the old check failed
3 of 12 runs with the nightly's message, the new one 0 of 12.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GeAhBjRBm5vN2ik3ddvVWW
Both merged without a CHANGELOG line, which this repo keeps per fix: the replace()
function-table fix (#2338) and the declare/set/return type check (#2339).

Refs #1258, mendixlabs/mxcli#2308.

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

test(bench): check hot-apply's two commands against a floor, not another step
docs(changelog): add the entries for #2338 and #2339
tabPageStoredProps did not list visibleroles, so under mdl 1 check refused
Visible: roles (…) on a tab page as 'cannot be stored' (MDL-WIDGET44), and a
headerless script was warned it was not written. The builder writes it, describe
prints it back and MxBuild 11.16.1 accepts an own-module role on a tab page.

Refs #1258, mendixlabs#1460.

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

A widget's role-based visibility can only name module roles of its own page,
snippet or layout. A role of another module passed check --references and exec,
and the build reported CE0149 'reselect roles'. MDL-GRANT04 is MDL-GRANT01's
sibling for a widget's roles: it needs no project and runs in the shared
pre-flight pass.

Measured on MxBuild 11.16.1 over 17 documents (container, dynamic text,
layout-grid row, navigation-list item, tab page, snippet, layout, alter page
insert): a foreign role is CE0149, an own-module role is clean, and viewing
access is irrelevant.

Refs #1258, mendixlabs#1460.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
fix(check): Visible: roles on a tab page is stored, so do not refuse it
report traceability read the --junit results into its evidence and then
reduced each requirement's tests to their names, so the report was
identical with and without --junit. Requirements now carry testResults
(name and status), and the table shows and marks a failing test.

Closes #2340

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

A 9.x runtime has no preview_execute_oql admin action, and mxcli oql's
error sent the user to restart with live-preview flags, which cannot help.
When both OQL routes are missing, the runtime's version is read (M2EE
about), and below Mendix 10 the error says OQL over the admin API needs 10+
and names the version. 10+ keeps the dev-flags hint.

Refs #2341

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
The java-dependencies skill now has a section on a library that registers
itself with the JVM: DriverManager does not see a userlib driver
(instantiate the driver class), DuckDB refuses a community extension file
(install it once, bundle the installed file and its .info, LOAD by name),
and only a real build compiles Java. Reported, not measured here.

Closes #2314

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

# Conflicts:
#	CHANGELOG.md
…24rqgv

Batch C: traceability test results, OQL on Mendix 9, Java dependency notes
feat(check): MDL-GRANT04 flags `Visible: roles` naming a role of another module
…cli names

make diag-coverage reads the diagnostic code IDs from the installed MxBuild's
Mendix.Modeler.Texts.dll (plain ASCII PO resources, no monodis needed), compares
them with the codes named in the string literals of non-test Go code and in the
Starlark lint rules, and ranks the codes mxcli does not name by how many bug-fix
records hit them. IDs only: none of Mendix's message text is read out or stored.

go/scanner reads the literals, so a code in a comment or a test does not count.
covered-as.tsv declares the checks that raise a code without naming it (CE0067 by
MDL003, CE0844 by E009). The proposal's hand-quoted '~6%' is replaced by a pointer
to the computed figure.

Refs #1258.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
A bare Setenv("HOME") leaves the developer's real ~/.mxcli in use on Windows,
where os.UserHomeDir reads USERPROFILE (#1256). TestNoBareHomeSetenv caught it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
feat(scripts): diag-coverage — which of Mendix's check diagnostics mxcli names
@ako
ako merged commit 7d10e92 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.

report traceability: --junit is accepted but changes nothing in the output

2 participants