Skip to content

check: fix #969 gaps (E001 value position, script-created SET targets, CE8812, MPR006, quoted params) - #978

Merged
ako merged 21 commits into
mainfrom
fix/969-check-gaps
Oct 4, 2026
Merged

ako merged 21 commits into
mainfrom
fix/969-check-gaps

Conversation

@ako

@ako ako commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Closes #969

All five check gaps from the JTSBootLogboek redesign. I measured every mxbuild and runtime claim before encoding it.

Per item

  1. E001 false positive. E001 and E002 used to run on every string literal in an enum or boolean slot. They now run only on literals in value position: the whole expression, a parenthesised one, or a then/else result (recursively) (mdl/exprcheck/parser.go, checkValueLiterals). A literal in a comparison, a function argument or an if-condition is no longer reported.

    • Side finding. When the enum and entity are created in the same script, check now catches a genuine change $X (EnumAttr = 'NW'). TypeCheckProgram overlays script-declared enumerations and attributes (create entity, alter entity add/modify attribute) onto the catalog reader (exprcatalog.DeclareEnumeration / DeclareAttribute).
    • Measured on 11.13.0. The if $Dir = 'NW' then E.NW else E.N and find('|NW|…', …) forms build with 0 errors. A quoted then 'NW' is CE0117, so it is still E001.
  2. alter page … set Action = microflow M.X on btn with X created in the same script. The SET dry run now treats a typed NotFoundError for a microflow, nanoflow, page or snippet that the script declares as satisfied (validate_alter_set.go, scriptDeclaresMissing). I did not register fake IDs in ctx.Cache, because exec shares the executor. Microflow, nanoflow and show-page targets were all affected and are all fixed.

    • Measured on 11.13.0. exec'd and mx check gives 0 errors.
  3. CE8812, new rule MDL-ASSOCDS01 (validate_assoc_list_source.go, hooked into the attribute-scope walk that already carries the data context). I measured 8 association shapes × list view, data grid and gallery on 11.13.0 and 11.14.0, with identical results:

    • CE8812 for a Reference followed from its FROM entity, with owner Default or Both.
    • CE8812 for a Reference with owner Both followed from its TO entity.
    • No error for the reverse of a default Reference, or for any ReferenceSet.

    The rule fires on exactly those 9 widgets and nothing else. It covers stored and script-declared associations. It skips specializations, self-associations and multi-hop paths.

  4. MPR006. I ran run --local --db-type hsqldb on 11.13.0 (React client) and loaded the page in headless Chromium via Playwright. Both a bare and a styled (Style: 'height: 6px;') empty container render. The widgets after them are present, with 0 console errors, and mx check reports 0 errors. MPR006 is now info in the quality category, reworded to "empty — valid and it renders, but probably unintended". The create-page skill no longer tells authors to pad containers.

  5. MDL-PARAMQUOTE01 info hint. It fires for a quoted ContentParams/CaptionParams value that is one string literal and either:

    • is a call of a known Mendix built-in, with ( directly after the name (not excluded), or
    • contains a $Var/Attr path, or is exactly $Var.

    It does not fire on 'Total (incl. VAT)', 'length (cm)', 'not(yet)', 'Price in $', 'Cost: $5', 'Sum(of parts)' or 'a' + 'b'. Runtime-verified: the quoted formatDateTime(...) renders as its literal text.

Test plan

  • go test ./mdl/executor/ ./mdl/exprcheck/... ./mdl/exprcatalog/ ./mdl/linter/... ./cmd/mxcli/ all pass.
  • make build, make lint, make check-conformance, make check-findings, make check-skill-mdl and make sync-skills all pass.
  • New tests, each with controls:
    • exprcheck/value_position_test.go
    • TestTypeCheckProgramSeesScriptCreatedEnum and TestTypeCheckProgramEnumSlotOperandsAreNotValues
    • TestAlterSet_ActionTargetsCreatedInScript and its control …Missing
    • TestAssocListSource_* (all 8 shapes × 3 widgets, data view control, script-declared association plus a ReferenceSet control)
    • TestQuotedTemplateParam_Hint
    • updated MPR006 metadata test
  • Revert checks (each removed fix makes its test fail with the reported symptom):
    • parser.go reverted → 6 failures in the value-position tests, including the 3× E001 on find.
    • declareScriptTypes disabled → "got [], want one E001".
    • scriptDeclaresMissing disabled → "microflow/nanoflow/page not found" for all three.
    • checkAssocListSource disabled → 10 failures.
    • looksLikeExpression stubbed → 4 positive-case failures.
    • old empty_container.go → category, severity and "crash" assertions fail.
  • End to end: checked and exec'd the repro scripts on copies of the 11.13 (jts2/App) and 11.14 (jts2/TA) scratch apps, then ran docker check.

Follow-ups (not done)

🤖 Generated with Claude Code

ako and others added 21 commits October 4, 2026 14:40
A literal compared with a String, passed to a function or used in an
if-condition inside an enumeration-slot expression was reported as the
value assigned to the enumeration, so exec refused valid microflows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#969)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#969)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bject association (#969)

Measured on mxbuild 11.13.0 and 11.14.0: a list view, data grid or gallery
over a Reference followed from its FROM entity, or over a Reference with
owner Both from either end, is CE8812. ReferenceSets and the reverse of a
default Reference build clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ash index

Compares every Unit.ContentsHash with base64(SHA-256) of its .mxunit and
reports mismatches, missing files and orphan files; --repair rewrites the
mismatched hashes in one transaction under the writer's Studio Pro guard.
exec and docker check warn when the index disagrees (~0.2 s on 900 units).

Part of #972 (item 1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Studio Pro 11.13 fails with "Unable to find 'system' property in 'system'"
when the branch has no upstream or git reports dubious ownership. docker
check, run --local and diag -p now warn with the remedy. Never fatal;
silent outside a repo, on a detached HEAD, under CI or with
MXCLI_NO_GIT_WARNINGS=1.

Part of #972 (item 3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #972.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e an expression (#969)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ders (#969)

Measured on Mendix 11.13.0 (React client) with run --local and a headless
browser: a bare and a styled empty container render, the widgets after
them are present, no console errors. The crash claim had no evidence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lone (#970)

theme create --from wrote a design's base palette into the base theme's
alt-variant mixin, so a light ground and ink landed in a dark palette
whose other surfaces stayed dark. Without a block for that variant the
mixin is now left as the base ships it and create prints a note.

Also: applyTokens matched the indent with \s*, which under (?m) swallowed
the preceding newline, putting the first token on the @mixin line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ace' (#970)

An unscoped create translations reaches the whole project, Marketplace
modules (and their Atlas templates/building blocks) included; a module
update replaces those. The default is kept (ADR-0011: what a committed
script writes does not change in place). The run now warns with a
per-module count, and the additive clause 'without marketplace' (create
and describe) keeps the run out of Marketplace modules and reports the
entries it left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
watchAndApply held a bare *WebClientWatcher. A bundler that exited was never
restarted, so every later page change failed with "watcher exited"; a failed
incremental build (ENOTDIR on web/pages mid-rewrite, measured on 11.13 after
adding an entity) dropped the change and the next one too; and
ensureClientServed's recovery ran a one-shot production bundle in the same
web/ directory while the watcher was still running.

bundlerSupervisor now owns the bundler: EnsureAlive restarts an exited one
with backoff, AwaitRebuild retries a failed incremental rebuild once with a
fresh bundler, and a recovery re-bundle replaces the bundler (stop and reap,
then start) instead of running beside it. The bundle-build limit is
configurable (--web-client-timeout, MXCLI_WEB_CLIENT_TIMEOUT) and a timeout
prints the tail of web-client-build.log. A change that restarts the runtime
says that browser sessions were dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After each apply watchAndApply moved its change baseline to the source's
current mtime, so an exec or save that landed during the build was folded
into the baseline and never rebuilt. Keep the baseline at the mtime the build
settled on; the build writes nothing under the watched source.

Found while reproducing #971.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A date picker's DateFormat / CustomDateFormat passed check, was stored as
the default Date, and was never described, so describe -> exec turned a
Studio Pro date-time picker into a date-only one (mendixlabs#1263).
The builder now reads them into the picker's FormattingInfo, the writer
stores it, describe prints non-default values, alter page set changes them,
and check refuses an unknown value, a pattern with no DateFormat and Custom
with no pattern (mxbuild CE0493) as MDL-WIDGET18. A text box's
DecimalPrecision / GroupDigits had the same drop and is fixed with it.

The unknown-property exemption for the dynamic-text format keys now applies
to dynamictext only, and a dynamic-text parameter's customDateFormat beside
an explicit non-Custom dateFormat (stored by Studio Pro) is accepted.

Closes #968

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and quick reference (#968)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-dark' into c25-974

# Conflicts:
#	CHANGELOG.md
# Conflicts:
#	CHANGELOG.md
#	mdl/executor/validate_widgets.go
@ako
ako merged commit 4fa2cf9 into main Oct 4, 2026
33 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

1 participant