Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e74bb3a
Name navigation associations apart from entities, and map hand-made ones
claude Nov 30, 2026
2602a10
diag-coverage: record codes measured as unreachable or handled (settl…
claude Nov 30, 2026
5fed0e6
Rebind Data Grid 2 columns when the data source's entity changes
claude Nov 30, 2026
a4e8f5c
Flag decisions captioned with their whole condition (#2685)
claude Nov 30, 2026
3ed2bbc
feat(pages): enumeration-typed page and snippet parameters
claude Nov 30, 2026
bceb106
fix: microflow notes linked to the start event or another note round-…
claude Nov 30, 2026
b65dcdb
check-gap: 20 more broken-script fixtures for the parity sweep
claude Nov 30, 2026
1739556
check-gap: record the round-2 parity results (9 gaps on MxBuild 11.16.1)
claude Nov 30, 2026
94e5e7d
Merge pull request #2686 from ako/claude/fix-2675-nav-association-names
ako Nov 30, 2026
1daf597
Merge pull request #2687 from ako/claude/fix-2673-dg2-stale-column-bi…
ako Nov 30, 2026
49265d6
check-gap: write the new fixtures in canonical MDL (conformance gate)
claude Nov 30, 2026
c573322
Merge pull request #2688 from ako/claude/laughing-lovelace-sv1mc5
ako Nov 30, 2026
1cab34e
Merge remote-tracking branch 'origin/main' into check-gap-fixtures-ro…
claude Nov 30, 2026
0979ac9
Merge pull request #2690 from ako/claude/stoic-curie-hspntf
ako Nov 30, 2026
23be4c7
Merge pull request #2691 from ako/claude/issue-triage-prioritization-…
ako Nov 30, 2026
ec4d8b4
Merge pull request #2689 from ako/diagcoverage-settled-codes
ako Nov 30, 2026
4b0c317
Merge pull request #2692 from ako/check-gap-fixtures-round2
ako Nov 30, 2026
45fa518
check: four gaps from the parity sweep (CE0047/CE0085/CE0084/CE0852/C…
claude Nov 30, 2026
a6aa82b
check: gofmt the domain-batch test
claude Nov 30, 2026
489520b
check: a DateTime constant token default is CE0047 too; fix the const…
claude Nov 30, 2026
3be3016
check: four microflow type gaps from the parity sweep (MDL117-MDL119,…
claude Nov 30, 2026
fb28e37
Merge pull request #2693 from ako/fix/check-gap-domain-batch
ako Nov 30, 2026
c3fc5ee
Merge remote-tracking branch 'origin/main' into fix/check-gap-microfl…
claude Nov 30, 2026
e21a869
Merge pull request #2694 from ako/fix/check-gap-microflow-batch
ako Nov 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl/executor", "date": "2026-11-30", "refs": ["ako/mxcli#1258"], "ce": ["CE0047", "CE0085", "CE0084", "CE0852", "CE7247"], "symptom": "Four mistakes passed `check -p` and `exec` and MxBuild 11.16.1 rejected the project: a constant default that does not parse as its type (CE0047), an index on a String(unlimited)/bare String (CE0085) or a HashedString/Binary attribute (CE0084), a change or create that sets an AutoNumber attribute (CE0852), and a microflow, nanoflow, page, snippet, enumeration or constant named with a reserved word (CE7247).", "file": "mdl/executor/validate_check_gap_domain.go (MDL113 ValidateConstantDefaults, MDL114 ValidateIndexAttributeTypes, MDL115 ValidateAutoNumberAssignments, MDL116 ValidateReservedDocumentNames), wired in validate_program.go; tests validate_check_gap_domain_test.go; fixtures mdl-examples/bug-tests/check-gap-domain-batch(.fail).mdl", "cause": "No check existed for any of the four. The reserved-word list (types.IsPlatformReserved) was already applied to entity and attribute names (MDL021) and parameters (MDL-PARAM01), but not to the other document kinds.", "insight": "**Found by the parity sweep, not by a bug report: none of the four had a finding record, so the record-driven ranking could never have surfaced them.** The accepted formats were measured rather than guessed, and several are not what one would write: a constant DateTime accepts only yyyy-mm-ddThh:mm:ss (a date, a Z, a space or milliseconds are all CE0047), an Integer accepts a leading sign and space and any length (no range check), a Boolean is case-insensitive true/false. A bare `String` is unlimited, so `index (Name)` on one is CE0085 too. The value judged is the one exec stores (%v of the literal), so an unquoted 1.5 for an integer is caught."}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl/executor", "date": "2026-11-30", "refs": ["ako/mxcli#1258"], "ce": ["CE0097", "CE0013", "CE0100", "CE0041", "CE0856", "CE0117"], "symptom": "Four microflow type mistakes passed `check -p` and `exec` and MxBuild 11.16.1 rejected them: head/tail/find (CE0097), count/sum (CE0013) or a loop (CE0100) over a single object; delete/commit (CE0041) or rollback (CE0856) of a primitive variable; a DateTime, Integer or Boolean compared with a string literal or a String with a number (CE0117); and `show page` passing an object of an unrelated entity, a generalization, a list or a primitive to an object parameter (CE0117).", "file": "mdl/executor/validate_object_list_operands.go (MDL117 checkObjectUsedAsList, MDL118 checkPrimitiveObjectAction, both microflow and nanoflow validators), mdl/exprcheck/parser.go checkComparisonKinds (E018, also in the no-project BuiltinCallHints), mdl/executor/validate_show_page_argument_types.go (MDL119, wired in validate_program.go). Tests alongside; fixtures mdl-examples/bug-tests/check-gap-microflow-batch(.fail).mdl", "cause": "The validator's variable-kind scope (varKinds) records primitives only, so nothing knew an entity-typed parameter or a created object was an object rather than a list; MDL-RETRIEVE01 covered only `retrieve … first` objects. The expression checker compared enumerations with string literals (E001) and nothing else. show page arguments were checked by name (check --references), never by type.", "insight": "**One mistake, five codes: which list activity the object reaches decides the code.** head/tail/find say CE0097, count/sum CE0013, a loop CE0100, and the existing MDL-RETRIEVE01 comment (measured on 11.13) says CE0097 for every list activity — on 11.16.1 an aggregate is CE0013. delete and commit share CE0041 while rollback is CE0856. For comparisons MxBuild uses classes, not types: any two numbers compare (Integer = 1.5 is clean), everything else only with its own kind. show page takes the parameter's entity or a specialization, never a generalization, the direction an author is most likely to get wrong when the page sits on a base entity."}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area":"mdl/executor","date":"2026-11-30","symptom":"After a Data Grid 2's microflow data source was changed to return another entity, re-running the unchanged page script printed \"Unchanged page\" and the columns stayed bound to the old entity: CE7247 \"Attribute 'Old.Rows.Year' is not an attribute of entity 'New.Rows'\" per column","cause":"pluggableMerge.object keeps a stored property that both builds agree on; a column attribute is bound to the grid's data source (DataSourceProperty ../datasource) and was exempt from the context check, so the stored OldRows binding was kept while both builds (statement and describe text, same context) bound NewRows; the rebuilt bytes then equalled the stored ones","file":"mdl/executor/cmd_pages_pluggable_patch.go (boundToSameEntity, refEntities), cmd_pages_builder_v3.go (entitiesRelated)","insight":"The catalog cache was a red herring: the return entity resolved fresh. Comparing the statement's build with describe's build can never see context drift, because both are built in today's context; only the stored value remembers yesterday's. A data-source-bound value is now kept only while its entity is the one the source yields, or a generalization or specialization of it, which is exactly the #832 case the exemption existed for — so the #832 tests are this fix's control. 'Unchanged' was honest about bytes, which is why the report's 'in sync check compares MDL text' theory was wrong.","refs":["ako/mxcli#2673"],"ce":["CE7247"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl-executor", "date": "2026-11-30", "refs": [], "symptom": "`create page M.P (Params: ( $S: Enumeration(Rules.RuleResult) ))` failed at exec with 'failed to resolve entity Rules.RuleResult: entity not found', and check --references reported it as a missing entity; describe of a Studio Pro enumeration page or snippet parameter printed `$par5: DataTypes$EnumerationType`, which does not re-parse, so describe -> exec could not round-trip it.", "file": "mdl/visitor/visitor_page.go buildPageParameter; mdl/executor/cmd_pages_builder_v3.go pageParamBSONType; mdl/backend/modelsdk/page_write.go paramTypeToGen; mdl/backend/modelsdk/page.go (page + snippet parameter read); mdl/executor/cmd_pages_describe.go pageParamTypeMDL / snippetParamTypeMDL", "cause": "Page variables had enumeration support (pageVariableType) but parameters never did: the visitor copied the enumeration's name into EntityType 'for backward compatibility', so every consumer resolved it as an entity; pageParamBSONType had no enumeration arm; paramTypeToGen fell through to a StringType; the readers kept only the $Type and dropped the Enumeration name, so describe had nothing to print but the $Type.", "fix": "An explicit Enumeration(Module.Name) parameter no longer fills EntityType; it maps to DataTypes$EnumerationType carrying EnumerationName through the page/snippet parameter structs, PageParameterSpec, the writer and both readers; describe prints Enumeration(Module.Name); an unknown enumeration is refused. A snippet enumeration parameter falls under the 11.17 primitive gate, with mxbuild's own caption 'Enumeration Module.Name'.", "insight": "A compatibility shim that copies a name into the field another kind reads ('also populate EntityType for entity/enum refs') makes every downstream consumer take the second kind for the first, and nothing errors until a resolve does. Measure each container separately: the enumeration PAGE parameter checks clean on mx 11.16.0, the identical SNIPPET parameter is CE0046 'Invalid data type 'Enumeration Snippet.Color'' there and clean on 11.17.0.", "test": "mdl/executor/param_enumeration_test.go, mdl/backend/modelsdk/param_enumeration_test.go, mdl/visitor/param_enumeration_test.go, cmd_alter_page_mock_test.go TestAlterPage_AddEnumerationParameter; each failed with its fix reverted. End to end: ako/TestApp Snippet.SnippetPrimitiveParameter describe -> exec -> mx 11.17.0 check (0 errors) -> describe identical."}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl/executor", "date": "2026-11-30", "symptom": "describe of a microflow note linked to the start event warned and re-exec dropped the link; a note linked to another note was dropped with no warning, and the note at the line's origin got an `id: n1` nothing referenced", "cause": "MDL had no way to state an AnnotationFlow whose destination prints no @annotation (the start event, another note). buildAnnotationsByTarget counted such a line toward the origin's 'shared' total and filed the note under a target that is never printed; collectFreeAnnotations keyed the 'unstated' warning on the line's origin, which in the reported case (stored from the attached note to the free one) is the attached note, which never prints the warning", "file": "mdl/executor/cmd_microflows_show_helpers.go (noteLinkGraph, annotationEmitter), cmd_microflows_builder_annotations.go (resolveNoteLinks), mdl/visitor/visitor_microflow_statements.go (link:), validate_microflow.go (MDL079)", "fix": "`@annotation(… link: start | link: <id>)` on the line's origin note; the builder resolves links after the whole flow is built (a target may be declared below); describe derives link-target labels once over the whole flow so the free-note prefix and the activity walk agree, and a link no longer makes its origin shared; `check` refuses an undeclared target and `link: start` in an alter fragment", "insight": "the warning existed but hung off the wrong end of the line: which note is a line's origin is a stored fact, so a test needs both directions. A note written before the first statement with no @position after it is attached to that statement, not free; a test script that forgets the @position measures the wrong shape (the splice refusal said so correctly)", "refs": ["ako/mxcli#2670", "mendixlabs/mxcli#1982", "mendixlabs/mxcli#1731", "ako/mxcli#1933"], "test": "mdl/executor/microflow_annotation_link_2670_test.go, mdl/visitor/visitor_annotation_link_2670_test.go"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area":"mdl/executor","date":"2026-11-30","symptom":"`create external entities` named the association for nav `Race.season` `season` beside the entity `Season`: CE0065 \"Duplicate name 'Season'\"; after the user replaced it with their own association the next import created `season` again beside it","cause":"uniqueAssocName compared names case-sensitively, while Mendix's module namespace does not; the re-import dedup recognised an association only by its RemoteParentNavigationProperty or by the nav name, so one without an OData mapping (made by hand, or rebuilt from describe output, which prints no mapping) never matched","file":"mdl/executor/cmd_contract.go (uniqueAssocName, createNavigationAssociations, unmappedAssociation, mapNavAssociation, writeAdoptedNavAssociations)","insight":"Measure what the platform says about the user's workaround before choosing between 'keep it' and 'replace it': an association between two external entities without an OData source is itself CE6597, so skipping it would have traded one error for another. The fix maps it to the navigation instead, keeping its name, and only when it is the sole navigation between the two entity types. `rename association` keeps the mapping and was never the trigger, despite the report. UpdateDomainModel writes the association list wholesale, so the mapping goes onto a fresh read that holds the associations the import just created.","refs":["ako/mxcli#2675"],"ce":["CE0065","CE6597"]}
2 changes: 1 addition & 1 deletion .claude/skills/mendix/overview-pages/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ module/

Snippets can accept parameters to display context-specific data. **A snippet
parameter is an entity, or — from Mendix 11.17 — a primitive** (`params: (
$Label: String )`). Below 11.17 Mendix rejects a primitive one with **CE0046**
$Label: String )`, or an enumeration: `$Status: Enumeration(Module.Status)`). Below 11.17 Mendix rejects a primitive one with **CE0046**
*"Invalid data type 'String'."*, and `check -p`/`exec` refuse it there
(**MDL-VERSION01**): keep the primitive on the calling page's parameters, or pass
an object and read the member inside the snippet.
Expand Down
8 changes: 4 additions & 4 deletions .claude/skills/mendix/write-microflows/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ set $Result = $A and $B; -- Logical AND
set $Result = $A or $B; -- Logical OR
set $Result = not $A; -- Logical NOT

-- Complex expressions
@caption 'Can process?' -- a decision's caption is drawn in its diamond: a phrase, not the condition (MDL-CAPTION01)
if $IsActive and $IsValid and $HasStock then
set $CanProcess = true;
end if;
Expand Down Expand Up @@ -631,7 +631,7 @@ commit $var [without events] [refresh];

### Flow Control Pattern
```mdl
if condition then ... [else ...] end if;
[@caption 'Order valid?'] if condition then ... [else ...] end if; -- caption a compound or long condition with a short phrase
loop $var in $list begin ... end loop;
return $value;
```
Expand All @@ -646,7 +646,7 @@ $var/Module.AssociationName/attribute -- Chained
### Annotation Pattern
```mdl
@position(200, 200) -- optional: omit it and mxcli lays the flow out in the project's layout-config.yaml style (never imitate a style with @position; never write a `@mxcli-layout:` doc line — mxcli no longer stores the style in the flow and removes an old one on the next write); to re-arrange an existing flow run `mxcli layout flows`; inside a LOOP body @position is in the loop BOX's coordinates (from its top-left), not the canvas's (ako/mxcli#2564); `check` warns MDL-LOOP01 when a body looks written in canvas coordinates
@caption 'Persist order'
@caption 'Persist order' -- on an if: a short phrase ('Has stints?'); without one the whole condition is the diamond's caption (MDL-CAPTION01, lint CONV012)
@color Green
@annotation 'Note about the next activity'
commit $Order; -- Annotations apply here
Expand All @@ -671,7 +671,7 @@ Geometry is `position: (x, y)` and `size: (w, h)`; omitted, the note goes 100px
above the activity at 200×50 (60px per extra), and DESCRIBE omits it again.
**An `@annotation` before a statement's `@position`/`@caption`/`@color`/`@anchor`
is a free note**, attached to nothing (where DESCRIBE prints one): put an
activity's own notes after them. In an `alter` fragment, attach a note the flow already has by its text, `@annotation(existing: '…')` — never by a describe `id:` ([pitfalls §14](reference/pitfalls.md#14-attaching-an-inserted-statement-to-a-note-the-flow-already-has)).
activity's own notes after them. In an `alter` fragment, attach a note the flow already has by its text, `@annotation(existing: '…')` — never by a describe `id:` ([pitfalls §14](reference/pitfalls.md#14-attaching-an-inserted-statement-to-a-note-the-flow-already-has)). A line from a note to the start event or to another note is `link: start` / `link: n1` on that note.

### Page Navigation Pattern
```mdl
Expand Down
21 changes: 21 additions & 0 deletions .claude/skills/mendix/write-microflows/reference/control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,27 @@ end if;

**Important**: Always close with `end if` (not just `end`).

**Caption a decision with a phrase, not its condition.** Studio Pro draws a
decision's caption inside the diamond, and an `if` with no `@caption` is
captioned with its whole condition, so `$Stints != empty and
length($Stints/json) >= 2` wraps mid-token in a box sized for a few words, and
repeats what the decision's Expression field already shows (ako/mxcli#2685).
Write a short question or condition in plain words:

```mdl
@caption 'Has stints?'
if $Stints != empty and length($Stints/json) >= 2 then
set $N = $N + 1;
end if;
```

`check` reports an `if` whose condition uses `and`/`or` or is longer than 40
characters and has no `@caption` (MDL-CAPTION01, info), and `mxcli lint`
reports a stored decision captioned with such a condition (CONV012). A short
single test (`$Count > 0`, `$Order/Status = Shop.Status.Open`) reads well as
its own caption and needs none. `@caption ''` stores an empty caption on
purpose and is not reported.

### Enumeration Comparisons

**CRITICAL**: When comparing enumeration values, use the fully qualified enumeration value, NOT a string literal.
Expand Down
Loading
Loading