Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9965a6a
odata: extract the per-entity contract build from the bulk import
claude Nov 21, 2026
dd0feda
odata: map a hand-written external entity's attributes to the contrac…
claude Nov 21, 2026
37e5da4
Merge remote-tracking branch 'origin/main' into claude/issue-triage-p…
claude Nov 21, 2026
856ffe2
odata: match a rewritten external entity's attributes by their stored…
claude Nov 21, 2026
69c8fde
test: give the documentation-rewrite external entity a cached contrac…
claude Nov 21, 2026
cda8626
Merge pull request #2498 from ako/claude/issue-triage-prioritization-…
ako Nov 21, 2026
0cc64df
check: name the missing entity step in an [Assoc.Attr …] XPath (#2491)
claude Nov 21, 2026
80cd4bf
splice: append after an error handler's rejoin, not before it (#2489)
claude Nov 21, 2026
479051c
import: name a self-association's junction columns as Mendix does (#1…
claude Nov 21, 2026
1179408
published rest: say which operations a rewrite removes; check the alt…
claude Nov 21, 2026
a089511
published rest: add and drop one operation of a stored resource (#2449)
claude Nov 21, 2026
21c3dad
published rest: quote resource names in the operation refusals with m…
claude Nov 21, 2026
8bf6011
Merge pull request #2499 from ako/claude/issue-triage-prioritization-…
ako Nov 21, 2026
105c5fa
lint: skip external entities in MPR017/MPR019, count mappings as writ…
claude Nov 21, 2026
fa34f15
fix(report all): give each kind a context, and survive a kind that pa…
claude Nov 21, 2026
1568267
Merge branch 'mendixlabs:main' into main
ako Nov 21, 2026
83aecde
fix(verify): the lint stage reports fixed baseline findings as resolved
claude Nov 21, 2026
4c66339
Merge pull request #2509 from ako/claude/gifted-fermi-2udffj
ako Nov 22, 2026
2d4fe1f
Merge pull request #2510 from ako/fix/2501-2502-lint-external-and-mapped
ako Nov 22, 2026
3677acc
fix(catalog): task queues and constants are not module dependencies
claude Nov 21, 2026
a85babc
Merge pull request #2511 from ako/claude/verify-lint-resolved
ako Nov 22, 2026
f28a747
check: reject a JSON structure custom name Mendix refuses (CE9524, MD…
claude Nov 22, 2026
e003724
skill: shorten the CE9524 custom-name note to fit the skill size bound
claude Nov 22, 2026
055c9bc
Merge pull request #2512 from ako/claude/gifted-fermi-2udffj
ako Nov 22, 2026
447cd19
Merge pull request #2513 from ako/fix/ce9524-json-custom-name
ako Nov 22, 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": "cmd/mxcli", "date": "2026-11-21", "symptom": "report architecture (and the catalog's GRAPH_MODULE_CYCLES behind module_cycles()) shows a false 9-module domain cycle through the module that holds a task queue", "cause": "the `queue` ref runs from the queue to the flow it runs and was counted as module use, so the queue's module 'depended on' every flow it runs; no edge recorded the caller's use of the queue. `by_name` (a constant naming a flow) was counted the same way", "file": "`mdl/catalog/builder_references.go` (extractQueueRefs, RefKindsNotModuleUse), `mdl/catalog/builder_graph.go` (loadModuleEdges), `cmd/mxcli/projectreport/architecture.go`", "insight": "A reference kind added for reachability (so a flow is not dead) is not automatically a dependency: ask which way the use runs before a kind enters module edges. One shared list (RefKindsNotModuleUse) keeps the catalog and the report agreeing", "refs": ["ako/mxcli#2503"], "test": "TestQueueAndByNameCloseNoModuleCycle"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "cmd/mxcli", "date": "2026-11-21", "symptom": "report all panics in the dependencies stage with \"cannot create context from nil parent\" (with a Marketplace token and Marketplace modules) and writes nothing, losing the reports already computed; without the panic its vulnerability check fails as \"net/http: nil Context\"", "cause": "report all and report readiness call each kind's collect with that kind's cobra command, which cobra never executed, so cmd.Context() is nil; files were only written after every kind was collected, and a panic in a collector was not recovered", "file": "`cmd/mxcli/cmd_report_all.go` (collectKind, safely, runReportAll)", "insight": "A cobra command called directly instead of through Execute has no context: give it the caller's (SetContext) at the one place that calls collectors, not in each collector. And a roll-up must treat one kind's panic like its error, and write each result as it is finished", "refs": ["ako/mxcli#2500"], "test": "TestReportAllGivesEachKindAContext"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "cmd-mxcli", "date": "2026-11-21", "refs": ["ako/mxcli#2506"], "ce": [], "symptom": "`verify` printed lint's passthrough line `0 new, 451 already known, 1 fixed` but its lint stage summary omitted the count and `--format json` said `\"resolved\": 0`; the mxcheck stage filled the same field correctly.", "file": "cmd/mxcli/cmd_verify.go lintOutcome. Test: cmd/mxcli/cmd_verify_test.go TestLintOutcomeCarriesFixedAsResolved", "cause": "The lint stage read Unchanged and UnchangedBySeverity from lint's baseline object and never read Fixed, so Outcome.Resolved stayed zero.", "insight": "**When two stages fill one report field, compare what each stage's outcome sets, not just what the runner prints.** The correct sibling (mxcheck) was the control that showed this was an omission. The outcome construction was inline in the runner and so untestable; extracting it was what made a test possible."}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl-executor", "date": "2026-11-21", "refs": ["ako/mxcli#2449", "mendixlabs/mxcli#1903"], "ce": [], "symptom": "`alter published rest service M.BookingApi add operation delete '{id}' in resource 'bookings' …` was a parse error (mismatched input 'operation' expecting RESOURCE): there was no way to add one operation to a stored resource short of restating the whole service.", "file": "grammar MDLParser.g4 alterPublishedRestServiceAction (ADD OPERATION IN RESOURCE '…' { … } / DROP OPERATION <method> ['path'] IN RESOURCE '…'); visitor_rest.go buildPublishedRestOperationDef (shared with the resource block); cmd_published_rest.go execAlterPublishedRestService; check in validate_published_rest_ops.go publishedRestAlterResourceProblems. Test: mdl/executor/alter_published_rest_operation_2449_test.go; mdl-examples/bug-tests/2449-published-rest-add-operation.mdl", "cause": "ALTER had only resource-level actions.", "insight": "**Reuse create's operation rule inside the alter, not a re-spelled one**: the resource block (`add operation in resource 'x' { <create's line>; }`) lets describe output be pasted into an add unchanged, and one visitor builder serves both, so they cannot drift. An operation is keyed resource+method+path exactly as the drop warning keys it."}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl-executor", "date": "2026-11-21", "refs": ["ako/mxcli#2449", "mendixlabs/mxcli#1903"], "ce": [], "symptom": "`create or modify published rest service M.BookingApi (...) { resource 'bookings' { delete '{id}' microflow M.PRS_DeleteBooking; } }` deleted the stored GET '' and GET '{id}' and printed only `Modified published rest service`; `alter … add resource 'bookings' { … }` with the stored name passed check and exec refused it (resource 'bookings' already exists).", "file": "mdl/executor/validate_published_rest_ops.go droppedPublishedRestOperations / CheckPublishedRestOperationDrops (MDL-REST06, wired in cmd/mxcli/cmd_check.go and execCreatePublishedRestService) and publishedRestAlterResourceProblems (validate.go). Test: mdl/executor/validate_published_rest_ops_2449_test.go", "cause": "A create-or-modify replaces the service's resource list wholesale with no comparison against the stored operations; the alter's resource actions were judged only by exec.", "insight": "**Key an operation as describe prints it (resource + method + path with slashes trimmed)**: `get microflow`, `get ''` and `get '/'` are one operation, and keying on the raw path would warn on every describe -> exec round trip. The control is exactly that round trip: Unchanged, no warning."}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl-executor", "date": "2026-11-21", "refs": ["ako/mxcli#2497", "ako/mxcli#2477"], "ce": ["CE6612", "CE6010", "CE6630"], "symptom": "`create external entity M.Order from consumed odata service M.Sales (EntitySet: 'Orders') (OrderId: Long, Title: String(100), Status: …)` passed check and exec; mx check 11.12.6 reported CE6010 \"Key cannot be empty\", CE6612 on every attribute and CE6630 for $top and $skip, on a contract `create external entities` builds at 0 errors.", "file": "mdl/executor/cmd_odata_single_contract.go resolveSingleExternalEntity (called from execCreateExternalEntity in cmd_odata.go); the per-entity build extracted from the bulk import as contractEntityAttributes (cmd_contract.go); deferred enumerations in cmd_contract_enums.go. Test: mdl/executor/create_external_entity_contract_2497_test.go", "cause": "The single form built attributes from the statement alone (DomainModels$StoredValue, no RemoteName/RemoteType), wrote no key, and took capabilities from the statement with false defaults; the bulk import, which reads the contract, was the only path that wrote the mapping.", "insight": "**Two statements that write one document kind must share the converter, not each have one**: extracting the bulk import's per-entity build and calling it from both made the single form correct by construction, and the describe -> exec round trip (Unchanged) is the check that the two agree. A rewrite of an imported entity had always worked because the carry restored the mapping by name — which is why this survived: only a fresh create or a newly added attribute reached the unmapped path."}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl-executor", "date": "2026-11-21", "refs": ["ako/mxcli#2489"], "ce": [], "symptom": "`create or modify microflow` appending `call microflow M.SUB_Startup();` before `return true;`, after `$R = call … on error without rollback begin … end error;`, spliced the call between the activity and the merge its handler rejoins (describe: `join rejoin1; end error; call …; merge rejoin1; return true;`), so the error path skipped it, and the next exec of the unchanged script was refused: the stored statement \"Join\" has no activity to address (MDL-V1-REBUILD).", "file": "mdl/executor/cmd_flow_modify.go insertAnchor. Test: mdl/executor/flow_splice_after_handler_2489_pedapp_test.go", "cause": "insertAnchor prefers InsertAfter on the stored activity before the gap. An activity whose custom handler rejoins has the rejoin merge on its normal outgoing flow, which the stored statements do not show (describe prints a merge only once a join names it), so the insert landed before the merge.", "insight": "**Print the stored statement list the planner sees, not the describe output**: describe after the splice showed a `merge`, but the list before it had none, which is why no gap-contents rule could see it. The anchor rule has to read the predecessor's shape (customErrorHandler), and the acceptance check is that the unchanged script then re-runs Unchanged."}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl-executor", "date": "2026-11-21", "refs": ["ako/mxcli#2491", "mendixlabs/mxcli#1916"], "ce": ["CE0161", "CE1613"], "symptom": "`grant read * on entity Repro.Car to Repro.R where [Car_Assignment.ReturnedOn = empty]` got MDL047 suggesting `[not(Car_Assignment.ReturnedOn/<Module.TargetEntity>)]` and a reference error calling `Car_Assignment.ReturnedOn` an association that is neither attribute nor association of Repro.Car; both kept the dotted name, and an agent followed them for 40 minutes.", "file": "mdl/executor/validate_xpath_missing_step.go missingEntityStepHint (used by validate_grant_refs.go xpathProblem and validate_retrieve_members.go); MDL047's xpathAssocEmptyHit.fix in validate_microflow.go. Test: mdl/executor/validate_xpath_missing_step_2491_test.go", "cause": "The XPath walk reads `A.B` as one qualified association name. `Car_Assignment.ReturnedOn` is association Car_Assignment then attribute ReturnedOn of its far end, with the entity step missing, which only a project lookup (AssociationTarget + member resolution) can tell.", "insight": "**A diagnostic's suggested fix must be re-checked against the input that produced it**: running `check` on the suggestion would have shown it fails the same way. The project tier can name the exact path (association/entity/attribute); the project-free rule cannot tell the two readings apart, so it offers both rather than guessing one."}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl/executor", "date": "2026-11-22", "refs": ["ako/mxcli#1258"], "ce": ["CE9524"], "symptom": "A `custom name map` name (or an `item of` name) that Mendix refuses, such as '1bad', 'has space', 'Owner', 'class' or an empty string, passed `check` and `exec` and was written; `mx check` reported CE9524 \"JSON element '(Object)/name' has an invalid custom name\".", "file": "mdl/executor/validate_json_structure_names.go validCustomName and invalidCustomNameViolations (MDL-JSON03). Tests validate_json_structure_names_test.go; fixtures mdl-examples/bug-tests/json-structure-invalid-custom-name.fail.mdl and json-structure-custom-names.mdl", "cause": "The earlier CE9524 findings were about GENERATED names (`$type`, `owner`, `%3A`) and were fixed by sanitising the default name, which is why a bare structure now builds clean; an explicit custom name is written verbatim and nothing judged it.", "insight": "**Re-measure an old finding's symptom before building on it: the class had moved.** Three records said CE9524 came from member names, and a fresh matrix showed every such member now builds clean (the default is sanitised). What remained was the author's own custom name, which is written verbatim. The accepted set was measured over 90 names rather than assumed from the message text: ASCII only (Größe, naïve are refused although they are letters), a lone underscore is refused, and the reserved list is the SAME case-insensitive one the platform uses for CE7247, so types.IsPlatformReserved is reused instead of a second list; String, System, Value, Entity, Date, List and User are not reserved. Every word of PlatformReservedWords and SystemAttributeNames was rejected in the second measurement, so the shared list is safe to reuse here."}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "mdl/other", "date": "2026-11-21", "refs": ["ako/mxcli#2501", "ako/mxcli#2502"], "ce": [], "symptom": "MPR019 reported 39 index findings on a frontend app, all 39 on external entities (no table in this app, nothing to index). MPR017 reported 4 of 4 false findings on one solution: three attributes set by a database-connection query Map and one attribute of an external entity, each read as nothing assigns it. An import mapping setting a Boolean from JSON true had the same false positive, reproduced on a fresh project.", "file": "mdl/linter/rules/mpr019_unindexed_constraint.go indexableEntity; mdl/linter/rules/mpr017_fixed_guard_attribute.go guardableEntity, mappedAttributeNames, collectAttributeFacts; tests mpr017_fixed_guard_attribute_test.go, mpr019_unindexed_constraint_test.go", "cause": "Both rules reasoned from the model's local writes. MPR019's indexableEntity was just Persistable, which an external entity is. MPR017 counted only Change and Create members as writes, so an attribute assigned by an import mapping, a database query or an external service read as unassigned.", "insight": "**A rule that concludes from the ABSENCE of a write has to enumerate every writer, and the report named two of at least four.** The database query and the external entity were real; the import mapping, a far commoner writer, was not in the report and showed up only by writing the same flag through a mapping on a fresh project. The first unit test covered only the pure helper and a stub of the wiring still passed; only a test through collectAttributeFacts failed it. That test needs a file-backed catalog (an in-memory one gives each pooled connection its own empty database, #2417) and a full entity row: a missing EntityType makes Entities() fail to scan and yield nothing, so a green test over an empty fixture proves nothing. Not covered yet: export mappings and message definitions as writers, and view entities for MPR019."}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"area": "sql", "date": "2026-11-21", "refs": ["ako/mxcli#1686"], "ce": [], "symptom": "`import from source query 'SELECT name, friend FROM later' into MyFirstModule.Person map (name as Name) link (friend to Person_Friend on Name)` through a self-Reference stored as a table failed: junction table INSERT … column \"myfirstmodule$personid\" of relation \"myfirstmodule$person_friend\" does not exist (SQLSTATE 42703).", "file": "sql/import_assoc.go JunctionColumns + LookupAssociationInfo (now reads parent_column_name); mdl/executor/cmd_import.go resolveOneLink. Test: sql/import_assoc_self_1686_test.go", "cause": "Both junction column names were derived from the entity by convention ({module}${entity}id), identical for a self-association; mendixsystem$association's parent_column_name/child_column_name were not read for table storage.", "insight": "**Measure the junction table, then read the system row rather than re-deriving it**: on 11.12.6 Person_Friend (Person to Person, table) is myfirstmodule$personid1 (parent) / personid2 (child), and mendixsystem$association records exactly that. A control run of the unfixed build on the same database is what showed the failure is real (the issue had only been read off the code). IMPORT LINK accepts Reference only, so a ReferenceSet repro stops earlier."}
25 changes: 13 additions & 12 deletions .claude/skills/mendix/json-structures-and-mappings/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ description: "Create and manage JSON structures, import mappings and export mapp
|---|---|
| 33-110 | Key Concepts |
| 111-122 | Export Mappings |
| 123-187 | JSON Structures |
| 188-234 | Message Definitions |
| 235-400 | Import Mappings |
| 401-498 | Export Mappings |
| 499-516 | Starting a Mapping Below the Payload Root |
| 517-600 | Microflow Actions |
| 601-613 | Browse |
| 614-661 | Export Workflow: PE → NPE → JSON |
| 662-668 | Realistic Example: Countries REST API |
| 669-692 | Placing Documents in Folders |
| 693-708 | Documentation |
| 709-723 | Common Mistakes |
| 123-188 | JSON Structures |
| 189-235 | Message Definitions |
| 236-401 | Import Mappings |
| 402-499 | Export Mappings |
| 500-517 | Starting a Mapping Below the Payload Root |
| 518-601 | Microflow Actions |
| 602-614 | Browse |
| 615-662 | Export Workflow: PE → NPE → JSON |
| 663-669 | Realistic Example: Countries REST API |
| 670-693 | Placing Documents in Folders |
| 694-709 | Documentation |
| 710-724 | Common Mistakes |

<!-- /skill-index -->
# JSON Structures, Import Mappings & Export Mappings
Expand Down Expand Up @@ -174,6 +174,7 @@ this structure carries, and it is one of the two names a member resolves by.
- A root-level array has no key: `item of 'Root' as 'Entry'`.
- An entry whose key is not in the snippet is an error (`MDL-JSON01`), as is
`item of` on something that is not an array (`MDL-JSON02`).
- A custom name is ASCII letters, digits and `_`, not starting with a digit, and not a reserved word in any case (`Owner`, `Type`, `Id`, `class`, ...): else `MDL-JSON03` (CE9524).

### Browse

Expand Down
Loading
Loading