Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Sections dated before 2026-09-19 predate the cycle and stay as they are. Named m
`docs/RELEASE-PROCESS.md` §8.

## Unreleased
- learn(security): **MxAdmin no longer "ships with password `1`" in the rules (#662)**: `learned-mdl-preflight.md` (baseline), `brd-to-build-plan.md` Step 7 and the rendered `generated/rules-access.md` now say MxAdmin exists only where the runtime host created it (Studio Pro's own run, or the buildpack's `ADMIN_PASSWORD`); `mxcli run --local` never creates it (`MxAdmin user ... does not exist!`) and `mxcli docker build` seeds `admin` / `Admin123!` instead, so sign in as a demo user. The "never touch MxAdmin" rule stays — field run, 2026-11
- fix(build-tree): **`bin/build-tree.py` excludes `node_modules` at any depth, not only at the project root (#764)**: `skip()` ran only for top-level names, so a custom widget's nested `widgets/<W>/node_modules` (1.2 GB in the field) was copied into `.mxtk/build/model/` on every full build, and one exec stalled for 13+ minutes. A nested `node_modules` already in an existing copy is removed on the next sync; the other excluded names (`deployment`, `docs`, `.mxcli`, `.mxtk`, ...) stay top-level only, since a widget may hold its own. The one exception is the top-level `javascriptsource/` tree, whose `node_modules` hold JavaScript actions' npm dependencies that mxbuild bundles: those are still copied. `test-build-tree.sh` B4c covers both. — a Greenfield field run (2026-11-13)

## v2026.11.16
Expand Down
4 changes: 2 additions & 2 deletions skills/brd-to-build-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,8 @@ Before any `GRANT` script, decide and document:

**⛔ Demo user password rules — read before writing any security MDL:**

- **Never touch MxAdmin.** Every project ships with MxAdmin and password `1` as a standard. Do not wipe it, reset it, or re-create it. Any script that modifies MxAdmin is wrong.
- **A demo user's password is mandatory in the grammar, so give it one throwaway value.** On mxcli v0.24.0 `CREATE DEMO USER '<name>' (<UserRole>)` with no password is a parse error (`mismatched input '(' expecting PASSWORD`, `mxcli syntax security demo-user`). Pick one value per project that meets the project's password policy (a demo user also needs security above Off, and a 12-character minimum is common — `walking-skeleton.md`). Record it in the build plan, reuse it for every demo user, and never use a real credential. Signing in as MxAdmin and switching demo user from inside the app still needs no password.
- **Never touch MxAdmin.** It exists only where the runtime host created it: Studio Pro's own run (App Security › Administrator) or the Mendix buildpack's `ADMIN_PASSWORD`. `mxcli run --local` never creates it (the runtime logs `MxAdmin user ... does not exist!`), and `mxcli docker build` seeds a demo user `admin` / `Admin123!` instead when the project has none. So sign in as a demo user. Do not wipe MxAdmin, reset it, or re-create it. Any script that modifies MxAdmin is wrong.
- **A demo user's password is mandatory in the grammar, so give it one throwaway value.** On mxcli v0.24.0 `CREATE DEMO USER '<name>' (<UserRole>)` with no password is a parse error (`mismatched input '(' expecting PASSWORD`, `mxcli syntax security demo-user`). Pick one value per project that meets the project's password policy (a demo user also needs security above Off, and a 12-character minimum is common — `walking-skeleton.md`). Record it in the build plan, reuse it for every demo user, and never use a real credential. Sign in as a demo user with that password; do not plan on an MxAdmin sign-in (rule above).
- **Pattern:** `create demo user 'firstname.lastname' password '<project demo password>' (<UserRole>);` — a single-quoted name and a project **user** role, not a qualified module role. The older form `create demo user "firstname.lastname" with roles "Module"."Role";` (no password) no longer parses (a card-disbursement requirements-driven build, 2026-09-25).

## Step 7: Navigation Wiring
Expand Down
2 changes: 1 addition & 1 deletion skills/generated/rules-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ None of these needs a STOP, but each passes `mxcli check` and fails later — at

- **Quote / unquote retry rule:** when any identifier fails at `mxcli check`, `mx check`, or runtime, try the other form before concluding anything. Applies to every identifier position. One form always works; the other may parse and still write wrong BSON.
- **Grants are co-located with the element, never deferred to one `security.mdl`:** `grant execute` ends the microflow script, `grant view` the page script, entity access the domain script — the entity and its access rule are one unit, same script, same commit. mxbuild raises no error for a missing grant; the only symptom is a blank screen or CE2729 once a non-admin role opens the page. A `roles.mdl` that only *creates* roles is fine. Pre-flight per entity: access rule in the same script? every module role that needs it granted? every module role composed into a user role? non-persistent DTOs — read/write only (CONV006)?
- **Demo users:** one throwaway policy-compliant password per project, recorded in the build plan (`brd-to-build-plan.md` Step 7). Never wipe, reset or re-create MxAdmin (ships with password `1`).
- **Demo users:** one throwaway policy-compliant password per project, recorded in the build plan (`brd-to-build-plan.md` Step 7). Never wipe, reset or re-create MxAdmin. It exists only where the runtime host created it (Studio Pro's own run, or the buildpack's `ADMIN_PASSWORD`); `run --local` never creates it — sign in as a demo user.
- **`mxcli check` does not catch corruption.** Every STOP row above is grammatically valid MDL that `check` passes; only mxbuild or SP open reveals the damage. Run the real mxbuild gate after every exec (`iterative-build-loop.md`).
- **mxcli v0.25 — keep the skills' spellings, never add `mdl 1;`.** The spellings in these skills (`count($L)`, `on error { … }`, `show page M.P($Obj = $Obj)`, `create or replace`) parse on v0.24.0 *and* v0.25.0; v0.25 only warns (`MDL-DEPR*`, "refused from `mdl 2`"). The new spellings (`count $L`, `on error begin … end error`, `P(Obj = $Obj)`) fail `check` on v0.24 — don't "modernise" a script the team may still run there. The hazard is the dialect header: v0.24 rejects it (`line 1:4 extraneous input '1'`), and under it v0.25 changes meanings — `show entity M.E` becomes an error (use `describe entity` / `list entities`; `-c` and the REPL already read this way), and `retrieve … limit 1` returns a *list* (use `first`) while `check` still passes. So strip the `mdl 1;` line from `describe` output before pasting it into a script, and never mix dialects in one file. Moving a whole file to mdl 1 on purpose: `mxcli fmt --upgrade -w -p <app>.mpr <script>`, then `check -p --references`, then exec once and run `bin/idempotence-check.sh <script>` (one `mxcli diff`; must say PASS, never a second exec).
- **`exec` is not `check`.** v0.24.0: `exec` refuses on reference errors and a few hard checks (MDL043, MDL044, MDL070, MDL-WIDGET14/19/24) but still writes scripts that plain `mxcli check` flags — e.g. an enum concatenation (E004). Run `mxcli check <script> -p <app>.mpr --references` yourself and read every error and warning before `exec`; a clean `exec` is not a clean `check`.
Expand Down
2 changes: 1 addition & 1 deletion skills/learned-mdl-preflight.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ None of these needs a STOP, but each passes `mxcli check` and fails later — at
- **Changing an existing DataGrid 2 column (insert or new `Attribute:`) is a whole-page re-emit, never `ALTER PAGE`.** v0.26.0: `REPLACE … column` passes `check`, fails mxbuild (`learned-dg2-patterns.md` rule 1).
- **Enumeration values named with reserved words** (`Receive`, `Move`, `Count`, `Open`, …) cannot be targeted by `alter enumeration … modify value` — v0.24.0 gives a parse error (`mismatched input 'Receive' expecting IDENTIFIER`), quoted or not, before any write. Use `create or modify enumeration` — which **replaces** the enum, so restate the full value set and the doc comment. Change captions only; renaming a value NAME silently breaks every reference and `mxcli check` will not say so.
- **Grants are co-located with the element, never deferred to one `security.mdl`:** `grant execute` ends the microflow script, `grant view` the page script, entity access the domain script — the entity and its access rule are one unit, same script, same commit. mxbuild raises no error for a missing grant; the only symptom is a blank screen or CE2729 once a non-admin role opens the page. A `roles.mdl` that only *creates* roles is fine. Pre-flight per entity: access rule in the same script? every module role that needs it granted? every module role composed into a user role? non-persistent DTOs — read/write only (CONV006)?
- **Demo users:** one throwaway policy-compliant password per project, recorded in the build plan (`brd-to-build-plan.md` Step 7). Never wipe, reset or re-create MxAdmin (ships with password `1`).
- **Demo users:** one throwaway policy-compliant password per project, recorded in the build plan (`brd-to-build-plan.md` Step 7). Never wipe, reset or re-create MxAdmin. It exists only where the runtime host created it (Studio Pro's own run, or the buildpack's `ADMIN_PASSWORD`); `run --local` never creates it — sign in as a demo user.
- **No `elseif` in page/widget expressions** (DynamicClasses, Visible, ContentParams, …): nest `else if … then … else …`. Microflow `IF/ELSEIF` compiles into decision splits; a page expression passes through to Mendix's parser, which has no `elseif` token. v0.24.0: `check` and `exec` pass it, `mx check` gives `[CE0117] Error(s) in expression at Container '…'`; lint does not flag it.
- **`mxcli check` does not catch corruption.** Every STOP row above is grammatically valid MDL that `check` passes; only mxbuild or SP open reveals the damage. Run the real mxbuild gate after every exec (`iterative-build-loop.md`).
- **mxcli v0.25 — keep the skills' spellings, never add `mdl 1;`.** The spellings in these skills (`count($L)`, `on error { … }`, `show page M.P($Obj = $Obj)`, `create or replace`) parse on v0.24.0 *and* v0.25.0; v0.25 only warns (`MDL-DEPR*`, "refused from `mdl 2`"). The new spellings (`count $L`, `on error begin … end error`, `P(Obj = $Obj)`) fail `check` on v0.24 — don't "modernise" a script the team may still run there. The hazard is the dialect header: v0.24 rejects it (`line 1:4 extraneous input '1'`), and under it v0.25 changes meanings — `show entity M.E` becomes an error (use `describe entity` / `list entities`; `-c` and the REPL already read this way), and `retrieve … limit 1` returns a *list* (use `first`) while `check` still passes. So strip the `mdl 1;` line from `describe` output before pasting it into a script, and never mix dialects in one file. Moving a whole file to mdl 1 on purpose: `mxcli fmt --upgrade -w -p <app>.mpr <script>`, then `check -p --references`, then exec once and run `bin/idempotence-check.sh <script>` (one `mxcli diff`; must say PASS, never a second exec).
Expand Down
Loading